1 using System.Data.Entity;
2 using System.Security.Claims;
3 using System.Threading.Tasks;
4 using Microsoft.AspNet.Identity;
5 using Microsoft.AspNet.Identity.EntityFramework;
7 namespace Projects.Models
9 // 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.
10 public class ApplicationUser : IdentityUser
12 public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
14 // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
15 var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
16 // Add custom user claims here
21 public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
23 public ApplicationDbContext()
24 : base("DefaultConnection", throwIfV1Schema: false)
28 public static ApplicationDbContext Create()
30 return new ApplicationDbContext();