public async Task <ActionResult <PhoneViewModel> > GetById(int id) { try { var phone = await _service.GetPhoneAsync(id); if (phone == null) { return(NotFound()); } return(Ok(phone)); } catch (Exception) { return(BadRequest(ErrorCode.RecordNotFound)); } }
public async Task <IHttpActionResult> GetPhone(int phoneId) { var phone = await _phoneService.GetPhoneAsync(phoneId); return(Ok(phone)); }
public async Task <IActionResult> GetByIdAsync([FromRoute] int id) { return(ReturnResult(await _phoneService.GetPhoneAsync(id))); }