New version

This commit is contained in:
2025-07-11 00:18:14 +02:00
parent 6b6c90272c
commit 49038de2b5
341 changed files with 18364 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
namespace Drab.LocalDb.IoC;
public interface ILocalDbConfiguration
{
public string ConnectionString { get; set; }
}

View File

@@ -0,0 +1,13 @@
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;
}
}