2020-10-24 23:23:22 +02:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace Birdmap.DAL
|
|
|
|
|
{
|
|
|
|
|
public static class Startup
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection ConfigureDAL(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
services.AddDbContext<BirdmapContext>(o =>
|
|
|
|
|
o.UseSqlServer(configuration["LocalDbConnectionString"]));
|
|
|
|
|
|
|
|
|
|
services.AddHealthChecks()
|
|
|
|
|
.AddDbContextCheck<BirdmapContext>();
|
|
|
|
|
|
2020-10-31 15:57:19 +01:00
|
|
|
|
services.AddTransient<DbInitializer>();
|
|
|
|
|
|
2020-10-24 23:23:22 +02:00
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|