internal P_Disposable(EfCoreDbContext efContext, IDataContext2 dataContext, ILogger logger, IDependencySupport outerDependencies) : base(outerDependencies: outerDependencies) { // efContext.EnsureNotNull(nameof(efContext)); // _efContext = efContext; _efContextString = efContext.ToString(); _dataContext = dataContext; _logger = logger; }
public static IQueryable Invoke(Type elementType, EfCoreDbContext context) { elementType .Arg(nameof(elementType)) .EnsureNotNull() .EnsureClass(); var invokerImpl = ImmutableInterlocked .GetOrAdd( location: ref __InvokerByElementType, key: elementType, valueFactory: locKey => ActivationUtilities.RequireConstructor <P_CreateQueryInvoke>(concreteType: typeof(P_Invoke <>).MakeGenericType(elementType))()); return(invokerImpl.CreateQuery(context)); }
protected override void Dispose(bool explicitDispose) { if (explicitDispose) { var logger = _logger; if (!(logger is null)) { logger .LogDebug( eventId: GenericEventIds.ExplicitDispose, message: $"Explicit dispose call.{Environment.NewLine}\tComponent:{Environment.NewLine}\t\t{{component}}", args: new object[] { _efContextString }); } } _efContext = null; _dataContext = null; _logger = null; _efContextString = null; // base.Dispose(explicitDispose); }
public EfCoreDbContextEventArgs(EfCoreDbContext ctx) { ctx.EnsureNotNull(nameof(ctx)); // Context = ctx; }
protected abstract IQueryable CreateQuery(EfCoreDbContext context);
protected override IQueryable CreateQuery(EfCoreDbContext context) { context.EnsureNotNull(nameof(context)); // return(context.CreateQuery <TElementType>()); }