Template
20 lines
597 B
C#
20 lines
597 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using RT.Infrastructure.Data;
|
|
|
|
namespace RT.Infrastructure;
|
|
|
|
public static class DependencyInjection
|
|
{
|
|
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
services.AddDbContext<AppDbContext>(options =>
|
|
options
|
|
.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
|
|
.UseSnakeCaseNamingConvention());
|
|
|
|
return services;
|
|
}
|
|
}
|