示例#1
0
        public async Task <bool> UpdateLoan(Guid id, MortgageDoc account)
        {
            try
            {
                account.UpdatedOn = DateTime.Now;
                ReplaceOneResult actionResult = await _context.Mortgages.ReplaceOneAsync(a => a.Id.Equals(id),
                                                                                         account, new UpdateOptions { IsUpsert = true });

                return(actionResult.IsAcknowledged && actionResult.ModifiedCount > 0);
            }
            catch (Exception ex)
            {
                // log or manage the exception
                throw ex;
            }
        }