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 }); }
Unique constraint is something like primary key constraint, which is used to make a record unique within all other records in sql database.
The unique constraint is used to enforce uniqueness on non-primary key columns. A primary key constrain column automatically includes a restriction for uniqueness. The unique constraint is similar to the primary key constraint except that it allows one NULL row.
Multiple unique constrains can be created on a table. The syntax of applying the unique constraint when creating table is:
CREATE TABLE table_Name
(
Col_name [CNTRAIN cstraint_name UNIQUE [CLUSTERED | NONCLUSTERED]
Col_name [, col_name [, col_name [, …]]])
Col_name [, col_name [, col_name [, …]]]
)
Where
Primary Key Constraint
Foreign Key constraint
The unique constraint is used to enforce uniqueness on non-primary key columns. A primary key constrain column automatically includes a restriction for uniqueness. The unique constraint is similar to the primary key constraint except that it allows one NULL row.
Multiple unique constrains can be created on a table. The syntax of applying the unique constraint when creating table is:
CREATE TABLE table_Name
(
Col_name [CNTRAIN cstraint_name UNIQUE [CLUSTERED | NONCLUSTERED]
Col_name [, col_name [, col_name [, …]]])
Col_name [, col_name [, col_name [, …]]]
)
Where
- Constraint_name species the name of the constraint to created.
- CLUSTERED | NONCLUSTERED are keywords that specify if a clustered or a nonclustered index is to be created for the unique constraint.
- Col_name specifies the name of the column(s) on which the unique constraint is to be defined.
Primary Key Constraint
Foreign Key constraint
Comments
Post a Comment