Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 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> >();
 }
Ejemplo n.º 3
0
 public EasyDataManager(IServiceProvider services, EasyDataOptions options)
 {
     Services = services;
     Options  = options;
 }