示例#1
0
        public async Task <IActionResult> PutLoanApplication(int id, LoanApplication loan)
        {
            if (id != loan.Id)
            {
                return(BadRequest());
            }

            var newLoanApplication = Mapper.MapApplication(loan);

            _repo.Changed(newLoanApplication);

            try
            {
                await _repo.SaveAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!(await LoanApplicationExists(id)))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }