public async Task <IActionResult> GetGebtor([FromQuery] string debtorId) { if (string.IsNullOrWhiteSpace(debtorId)) { return(BadRequest()); } DebtorResponse debtor = await _deptorService.GetById(debtorId); return(Ok(debtor)); }
public DebtorResponse GetDebtor(int id) { var Response = new DebtorResponse(); try { Response.Debtor = Response.Debtor = DebtorDataMember.ConvertFromEntity( UnitOfWork.DebtorRepository.GetById(id) ); Response.IsSuccessful = true; } catch (Exception ex) { Response.IsSuccessful = false; Response.ErrorMessage = ex.Message; } return(Response); }