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 }); }
This is type of binary operator, which means it works with more than one operand. In c#, this can be understood from given code
int a=10,b=5;
a -=b;
Console.WriteLine(a);
In this preceding code, we get 5 as a result. It means subtract operand b from a. This types of expression is equivalent to a=a-b. Lets take an simple example with output
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a = 10;
int b = 20;
b -= a;
Console.WriteLine(b);
Console.ReadKey();
}
}
}
int a=10,b=5;
a -=b;
Console.WriteLine(a);
In this preceding code, we get 5 as a result. It means subtract operand b from a. This types of expression is equivalent to a=a-b. Lets take an simple example with output
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a = 10;
int b = 20;
b -= a;
Console.WriteLine(b);
Console.ReadKey();
}
}
}
Comments
Post a Comment