public static AppUserManager Create(IdentityFactoryOptions <AppUserManager> options, IOwinContext context) { AviaCompanyContext db = context.Get <AviaCompanyContext>(); AppUserManager manager = new AppUserManager(new UserStore <AppUser>(db)); manager.PasswordValidator = new PasswordValidator { RequiredLength = 6, RequireNonLetterOrDigit = false, RequireDigit = false, RequireLowercase = false, RequireUppercase = false }; return(manager); }
public void CreateDatabase() { Database.SetInitializer(new DropCreateDatabaseAlways <AviaCompanyContext>()); var cities = new List <City>() { new City() { CityId = 1, CityName = "Kharkov" } }; using (var context = new AviaCompanyContext()) { cities.ForEach(c => context.Cities.Add(c)); context.SaveChanges(); } }