using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; namespace SystemsHub.Ums.Domain { // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more. public class User : IdentityUser { //http://www.asp.net/identity/overview/extensibility/change-primary-key-for-users-in-aspnet-identity public string FirstName { get; set; } public string LastName { get; set; } public string ProfileRelativeImageUrl { get; set; } public int LanguageId { get; set; } public int DepartmentId { get; set; } public virtual Language Language { get; set; } public virtual Department Department { get; set; } public virtual List Websites { get; set; } public bool IsAdmin => Roles.Any(r => r.Role.Name == "Admin"); public bool IsSuperUser => Roles.Any(r => r.Role.Name == "Super User"); public async Task GenerateUserIdentityAsync(UserManager manager) { // Note the authenticationType must match the one defined in // CookieAuthenticationOptions.AuthenticationType var userIdentity = await manager.CreateIdentityAsync( this, DefaultAuthenticationTypes.ApplicationCookie); // Add custom user claims here return userIdentity; } } public class CustomUserClaim : IdentityUserClaim { } public class CustomUserLogin : IdentityUserLogin { } }