public async Task UpdateAsync(PaymentDeadline paymentDeadlineToSave) { Stopwatch timespan = Stopwatch.StartNew(); try { db.Entry(paymentDeadlineToSave).State = EntityState.Modified; await db.SaveChangesAsync(); timespan.Stop(); log.TraceApi("SQL Database", "PaymentDeadlineRepository.UpdateAsync", timespan.Elapsed, "paymentDeadlineToSave={0}", paymentDeadlineToSave); } catch (Exception e) { log.Error(e, "Error in PaymentDeadlineRepository.UpdateAsync(paymentDeadlineToSave={0})", paymentDeadlineToSave); throw; } }
public async Task CreateAsync(PaymentDeadline paymentDeadlineToAdd) { Stopwatch timespan = Stopwatch.StartNew(); try { db.PaymentDeadlines.Add(paymentDeadlineToAdd); await db.SaveChangesAsync(); timespan.Stop(); log.TraceApi("SQL Database", "PaymentDeadlineRepository.CreateAsync", timespan.Elapsed, "paymentDeadlineToAdd={0}", paymentDeadlineToAdd); } catch (Exception e) { log.Error(e, "Error in PaymentDeadlineRepository.CreateAsync(paymentDeadlineToAdd={0})", paymentDeadlineToAdd); throw; } }
public async Task DeleteAsync(int paymentDeadlineID) { Stopwatch timespan = Stopwatch.StartNew(); try { PaymentDeadline paymentDeadline = await db.PaymentDeadlines.FindAsync(paymentDeadlineID); db.PaymentDeadlines.Remove(paymentDeadline); await db.SaveChangesAsync(); timespan.Stop(); log.TraceApi("SQL Database", "PaymentDeadlineRepository.DeleteAsync", timespan.Elapsed, "paymentDeadlineID={0}", paymentDeadlineID); } catch (Exception e) { log.Error(e, "Error in PaymentDeadlineRepository.DeleteAsync(paymentDeadlineID={0})", paymentDeadlineID); throw; } }