- 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.
13 lines
357 B
C#
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;
|
|
}
|
|
} |