I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Suppose you have a project that it contain multiple main method in different classes Then How to set start-up object
your code are :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
}
}
class program1
{
static void Main(string[] args)
{
}
}
}
After run your application you get error
Following some steps for solution:
Step-1 : On Application name, Select properties
your code are :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
}
}
class program1
{
static void Main(string[] args)
{
}
}
}
After run your application you get error
Following some steps for solution:
Step-1 : On Application name, Select properties
Step-2: Select Application tab in left pane, Choose Startup object in right pane
Step-3: After choosing startup object run your application
Comments
Post a Comment