Пример #1
0
 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));
 }
Пример #2
0
 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)
 {
 }
Пример #4
0
        public GalaxyDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options)
        {
            _instanceId = Guid.NewGuid();

            this._appSession = appSession ?? throw new ArgumentNullException(nameof(appSession));
        }
Пример #5
0
 public IdentityContext(DbContextOptions options, IAppSessionBase appSession) : base(options, appSession)
 {
 }
Пример #6
0
 public CustomerSampleDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options, appSession)
 {
 }
Пример #7
0
 public GalaxyDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options)
 {
 }