public async Task AddAsync(IPaymentRequest paymentRequest) { using (var context = _contextFactory.CreateDataContext()) { var entity = PartnerPaymentEntity.Create(paymentRequest); context.PartnersPayments.Add(entity); await context.SaveChangesAsync(); } }
public async Task UpdatePaymentAsync(PaymentModel paymentModel) { using (var context = _contextFactory.CreateDataContext()) { var entity = PartnerPaymentEntity.Create(paymentModel); entity.LastUpdatedTimestamp = DateTime.UtcNow; context.PartnersPayments.Update(entity); await context.SaveChangesAsync(); } }