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);
        }
Ejemplo n.º 2
0
        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);
        }