Exemplo n.º 1
0
        /// <summary>
        /// Asynchronously saves all changes made in the BugContext to the database.
        /// </summary>
        /// <param name="acceptAllChangesOnSuccess">
        ///     Indicates whether <see cref="M:Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.AcceptAllChanges" /> is called after the changes have
        ///     been sent successfully to the database.
        /// </param>
        /// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
        /// <returns>
        ///     A task that represents the asynchronous save operation. The task result contains the
        ///     number of state entries written to the database.
        /// </returns>
        public override async Task <int> SaveChangesAsync(bool acceptAllChangesOnSuccess,
                                                          CancellationToken cancellationToken = default(CancellationToken))
        {
            ChangeTracker.ApplyAuditInformation();

            return(await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken));
        }
Exemplo n.º 2
0
        public override int SaveChanges()
        {
            ChangeTracker
            .ApplyAuditInformation(_AuthUserService);

            base.SaveChanges();
            return((int)TransactionStatus.SUCCESS);
        }
Exemplo n.º 3
0
        public override Task <int> SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            if (ChangeTracker.HasChanges())
            {
                ChangeTracker
                .ApplyAuditInformation(_AuthUserService);

                base.SaveChangesAsync(cancellationToken);
                return(Task.FromResult((int)TransactionStatus.SUCCESS));
            }

            return(Task.FromResult((int)TransactionStatus.UNCHANGED));
        }
Exemplo n.º 4
0
 public override async Task <int> SaveChangesAsync(
     CancellationToken cancellationToken = default(CancellationToken))
 {
     ChangeTracker.ApplyAuditInformation();
     return(await base.SaveChangesAsync(cancellationToken));
 }
Exemplo n.º 5
0
 public override int SaveChanges()
 {
     ChangeTracker.ApplyAuditInformation();
     return(base.SaveChanges());
 }