예제 #1
0
        public async Task <ActionResult> Delete(int id)
        {
            try
            {
                if (id != 0)
                {
                    var customerinDb = await _ILoan.LoanListById(id);

                    if (customerinDb == null)
                    {
                        return(NotFound());
                    }
                    _ILoan.DeleteLoan(id);
                    return(NoContent());
                }
                else
                {
                    return(StatusCode(StatusCodes.Status406NotAcceptable));
                }
            }

            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, ex));
            }
        }