DRAB/Drab.LocalDb/IoC/IocLocalDbRegister.cs
2025-07-11 00:18:14 +02:00

13 lines
435 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace Drab.LocalDb.IoC;
public static class IocLocalDbRegister
{
public static IServiceCollection AddLocalDatabase(this IServiceCollection services, ILocalDbConfiguration localDbConfiguration)
{
services.AddDbContext<LocalDbContext>(cx => cx.UseSqlite(localDbConfiguration.ConnectionString));
return services;
}
}