-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathDependencyInjection.cs
More file actions
22 lines (21 loc) · 817 Bytes
/
DependencyInjection.cs
File metadata and controls
22 lines (21 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SimplCommerce.Module.Core.Data;
using SimplCommerce.Module.Core.Extensions;
namespace SimplCommerce.Db.PgSql
{
public static class DependencyInjection
{
public static IServiceCollection AddDbConfiguration(this IServiceCollection services, string connectionString)
{
services.AddDbContextPool<SimplDbContext>(options =>
options.UseNpgsql(connectionString,
x => x.MigrationsAssembly(
typeof(DependencyInjection).Assembly.FullName)
));
return services;
}
}
}