Updated code to support conditional compilation for .NET Framework and .NET. Introduced nullable reference types in `DbRepository.cs` and ensured proper initialization of service registration queues in `DependencyInjection.cs`. Modified `DbRepositoryFactory.cs` and `DbSetFactory.cs` to maintain consistent structure across frameworks. These changes enhance compatibility and improve type safety.
25 lines
471 B
C#
25 lines
471 B
C#
using Microsoft.EntityFrameworkCore;
|
|
#if NETFRAMEWORK
|
|
using System;
|
|
#endif
|
|
|
|
namespace DigitalData.Core.Infrastructure.Factory
|
|
#if NET
|
|
;
|
|
#elif NETFRAMEWORK
|
|
{
|
|
#endif
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
#if NETFRAMEWORK
|
|
}
|
|
#endif |