TekH 90a12f52bc feat(infrastructure): add DbSetFactory registration in DependencyInjection
- Introduced AddDbSetFactory to support DbSet factory registration for entities.
- Updated RepositoryConfiguration.RegisterFromAssembly to register both repositories and DbSet factories.
- Changed RegisterFromAssembly and RegisterEntity to void methods instead of fluent interface.
- Extracted DbRepositoryFactory into its own Factory namespace for better separation of concerns.
2025-09-11 17:20:47 +02:00

13 lines
357 B
C#

using Microsoft.EntityFrameworkCore;
namespace DigitalData.Core.Infrastructure.Factory;
public class DbSetFactory<TDbContext,TEntity> where TDbContext : DbContext where TEntity : class
{
public readonly Func<TDbContext, DbSet<TEntity>> Create;
public DbSetFactory(Func<TDbContext, DbSet<TEntity>> create)
{
Create = create;
}
}