public async Task <IActionResult> GetTitipanKapal(int Id) { try { var result = await context.GetTitipanKapal(Id); return(Ok(result)); } catch (Exception ex) { return(BadRequest(new ErrorMessage(ex.Message))); } }
public async Task <IHttpActionResult> GetTitipanKapal(int Id) { var result = await context.GetTitipanKapal(Id); if (result != null) { return(Ok(result)); } else { return(Content(HttpStatusCode.NoContent, "Data Tidak Ditemukan")); } }