예제 #1
0
 public void Initialize(AnyStoreContext context)
 {
     context.Database.EnsureCreated();
     if (!context.Roles.Any())
     {
         SeedRoles(context);
     }
 }
예제 #2
0
        private async void SeedRoles(AnyStoreContext context)
        {
            context.Roles.AddRange(new IdentityRole {
                Name = RolesEnum.Administrator.ToString(), NormalizedName = RolesEnum.Administrator.ToString().ToUpper()
            });

            await context.SaveChangesAsync();
        }