public EasyDataManagerEF(IServiceProvider services, EasyDataOptions options) : base(services, options)
        {
            DbContext = (TDbContext)services.GetService(typeof(TDbContext))
                        ?? throw new ArgumentNullException($"DbContext is not registered in services: {typeof(TDbContext)}");

            Options = options;
        }
 public static void UseDbContext <TDbContext>(this EasyDataOptions easyDataOptions, Action <DbContextMetaDataLoaderOptions> loaderOptionsBuilder = null) where TDbContext : DbContext
 {
     if (loaderOptionsBuilder != null)
     {
         easyDataOptions.MetaDataLoaderOptionsBuilder = (options) => loaderOptionsBuilder(options as DbContextMetaDataLoaderOptions);
     }
     easyDataOptions.UseManager <EasyDataManagerEF <TDbContext> >();
 }
Exemple #3
0
 public EasyDataManager(IServiceProvider services, EasyDataOptions options)
 {
     Services = services;
     Options  = options;
 }