Пример #1
0
 public EfCoreDbContext(DbContextOptions options)
     : base(options: options)
 {
     _isReadOnly = true;
     _disposable = new P_Disposable(efContext: this, dataContext: null, logger: null, outerDependencies: null);
 }
Пример #2
0
        //public EfCoreDbContext(EfCoreDbContextCtorArgs args)
        //	: this(
        //			storeConnection: args.EnsureNotNull(nameof(args)).Value.StoreConnection,
        //			edm: args.Edm,
        //			isReadOnly: args.IsReadOnly,
        //			ownsStoreConnection: args.OwnsStoreConnection,
        //			dataCtx: args.DataContext,
        //			dataCtxDescription: args.DataContextDescription,
        //			dependencies: args.Dependencies) { }

        //protected EfCoreDbContext(
        //	DbConnection storeConnection,
        //	DbCompiledModel edm,
        //	bool isReadOnly,
        //	bool ownsStoreConnection,
        //	IDataContext2 dataCtx = default,
        //	IDataContextDescription dataCtxDescription = default,
        //	IDependencySupport dependencies = default)
        //	: base(existingConnection: storeConnection, model: edm, contextOwnsConnection: ownsStoreConnection) {
        //	//
        //	if (!(dataCtxDescription is null))
        //		dataCtx.EnsureNotNull(nameof(dataCtx));
        //	//
        //	_isReadOnly = isReadOnly;
        //	_preferNoTracking = dataCtx?.PreferNoTracking ?? false;
        //	_disposable = new P_Disposable(efContext: this, dataContext: dataCtx, outerDependencies: dependencies);
        //}

        //public EfCoreDbContext(
        //	DbConnection storeConnection,
        //	bool isReadOnly,
        //	bool ownsStoreConnection,
        //	IDependencySupport dependencies = null)
        //	: base(existingConnection: storeConnection, contextOwnsConnection: ownsStoreConnection) {
        //	//
        //	_isReadOnly = isReadOnly;
        //	_disposable = new P_Disposable(efContext: this, dataContext: null, outerDependencies: dependencies);
        //}

        #endregion

        protected EfCoreDbContext(EfCoreDbContextCtorArgs args)
            : base(options: args.EnsureNotNull(nameof(args)).Value.Options)
        {
            _isReadOnly = args.IsReadOnly;
            _disposable = new P_Disposable(efContext: this, dataContext: null, logger: args.Logger, outerDependencies: null);
        }