/// <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)); }
public override int SaveChanges() { ChangeTracker .ApplyAuditInformation(_AuthUserService); base.SaveChanges(); return((int)TransactionStatus.SUCCESS); }
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)); }
public override async Task <int> SaveChangesAsync( CancellationToken cancellationToken = default(CancellationToken)) { ChangeTracker.ApplyAuditInformation(); return(await base.SaveChangesAsync(cancellationToken)); }
public override int SaveChanges() { ChangeTracker.ApplyAuditInformation(); return(base.SaveChanges()); }