public async Task Update(Account account, Debit debit) { Entities.Debit debitEntity = new Entities.Debit { AccountId = debit.AccountId, Amount = debit.Amount, Description = debit.Description, Id = debit.Id, TransactionDate = debit.TransactionDate }; await _context.Debits.InsertOneAsync(debitEntity); }
public async Task Update(Account account, Debit debit) { Entities.Debit debitEntity = new Entities.Debit { AccountId = debit.AccountId, Amount = debit.Amount, Description = debit.Description, Id = debit.Id, TransactionDate = debit.TransactionDate }; var filter = Builders <Entities.Debit> .Filter.Eq(e => e.Id, debit.Id); await _context.Debits.ReplaceOneAsync(filter, debitEntity); }