Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ServiceScope.cs 363B

1234567891011121314
  1. namespace Diligent.WebAPI.Data.Extensions;
  2. public static class ServiceScope
  3. {
  4. public static void SetupData(this IServiceScope scope)
  5. {
  6. var dbContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
  7. if (dbContext.Database.GetPendingMigrations().Any())
  8. {
  9. dbContext.Database.Migrate();
  10. }
  11. }
  12. }