Ejemplo n.º 1
0
 public static IHost SeedDatabase(this IHost builder)
 {
     using (var scope = builder.Services.CreateScope())
     {
         using (var context = scope.ServiceProvider.GetService <LubricantContext>())
         {
             DaySeed.DaysData(context);
             RoleSeed.RolesData(context);
             UserSeed.UsersData(context);
             context.SaveChanges();
         }
     }
     return(builder);
 }