You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ServiceCollection.cs 553B

1234567891011121314151617
  1. namespace Diligent.WebAPI.Data.Extensions;
  2. public static class ServiceCollection
  3. {
  4. public static void ConfigureData(this IServiceCollection services, IConfiguration configuration)
  5. {
  6. services.AddDbContext<DatabaseContext>(options =>
  7. {
  8. if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
  9. {
  10. options.EnableSensitiveDataLogging();
  11. }
  12. options.UseSqlServer(configuration.GetConnectionString(nameof(Diligent.WebAPI)));
  13. });
  14. }
  15. }