birbmap/Birdmap.DAL/Startup.cs
2020-10-31 15:57:19 +01:00

23 lines
646 B
C#

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>();
services.AddTransient<DbInitializer>();
return services;
}
}
}