public UnitOfWork(IGalaxyContextAsync dataContext , IAppSessionBase session , IMediator mediator) { _dataContext = dataContext ?? throw new ArgumentNullException(nameof(dataContext)); _session = session ?? throw new ArgumentNullException(nameof(session)); _repositories = new Dictionary <string, dynamic>(); _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); }
public void SyncObjectsAuditPreCommit(IAppSessionBase session) { if (!ChangeTracker.Entries().Any(x => x.Entity is IFullyAudit)) { return; } foreach (var dbEntityEntry in ChangeTracker.Entries <IFullyAudit>()) { var entity = ((IFullyAudit)dbEntityEntry.Entity); if (((IObjectState)dbEntityEntry.Entity).ObjectState == ObjectState.Added) { entity.SyncAuditState(creatorUserId: session.UserId, tenantId: session.TenantId, creationTime: DateTime.Now); } else { entity.SyncAuditState(lastmodifierUserId: session.UserId, tenantId: session.TenantId, lastModificationTime: DateTime.Now , creatorUserId: entity.CreatorUserId, creationTime: entity.CreationTime); } } }
public PaymentSampleDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options, appSession) { }
public GalaxyDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options) { _instanceId = Guid.NewGuid(); this._appSession = appSession ?? throw new ArgumentNullException(nameof(appSession)); }
public IdentityContext(DbContextOptions options, IAppSessionBase appSession) : base(options, appSession) { }
public CustomerSampleDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options, appSession) { }
public GalaxyDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options) { }