using System.Data.Entity; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using System.ComponentModel.DataAnnotations; namespace HealthchoiceMVC.NonDbModels { // 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 ApplicationUser : IdentityUser { // public string Name { get; set; } 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 userIdentity.AddClaim(new Claim("FirstName", FirstName)); userIdentity.AddClaim(new Claim("LastName", LastName)); return userIdentity; } [Display(Name = "First name")] public string FirstName { get; set; } [Display(Name = "Last name")] public string LastName { get; set; } [Display(Name = "Cellphone number")] public string ContactNumber { get; set; } [Display(Name = "Account Type")] public int AccountType { get; set; } } public class ApplicationDbContext : IdentityDbContext { public ApplicationDbContext() : base("HCUserDBConnectionString", throwIfV1Schema: false) { } public static ApplicationDbContext Create() { return new ApplicationDbContext(); } public System.Data.Entity.DbSet user_role { get; set; } public System.Data.Entity.DbSet user_type { get; set; } public System.Data.Entity.DbSet providers { get; set; } } }