예제 #1
0
        public override int SaveChanges(bool acceptAllChangesOnSuccess)
        {
            ProccessChangeTrackerResult proccessChangeTrackerResult = ChangeTrackerAuditService.ProccessChangeTracker(ChangeTracker, _auditOptions);
            AuditSubjectData            auditSubjectData            = _auditSubjectDataService.Get();

            IEnumerable <AuditEntity> auditEntities = proccessChangeTrackerResult.AuditObjectData
                                                      .Select(x => new AuditEntity(
                                                                  auditObjectData: x,
                                                                  auditSubjectData: auditSubjectData));

            Audit.AddRange(auditEntities);

            return(base.SaveChanges());
        }
예제 #2
0
        public async override Task <int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
        {
            ProccessChangeTrackerResult proccessChangeTrackerResult = await ChangeTrackerAuditService.ProccessChangeTrackerAsync(ChangeTracker, _auditOptions);

            AuditSubjectData auditSubjectData = _auditSubjectDataService.Get();

            IEnumerable <AuditEntity> auditEntities = proccessChangeTrackerResult.AuditObjectData
                                                      .Select(x => new AuditEntity(
                                                                  auditObjectData: x,
                                                                  auditSubjectData: auditSubjectData));

            Audit.AddRange(auditEntities);

            return(await base.SaveChangesAsync());
        }