コード例 #1
0
ファイル: UnitOfWork.cs プロジェクト: eyazici90/Samples
 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
ファイル: GalaxyDbContext.cs プロジェクト: eyazici90/Samples
 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);
         }
     }
 }
コード例 #3
0
 public PaymentSampleDbContext(DbContextOptions options, IAppSessionBase appSession) : base(options, appSession)
 {
 }
コード例 #4
0
ファイル: GalaxyDbContext.cs プロジェクト: eyazici90/Samples
        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)
 {
 }