public FileStreamResult GetEye(int id) { try { var data = DiagnosisData.Get(id).Eye.Data; return(new FileStreamResult(data.ToStream(), "image/jpeg")); } catch (Exception) { return(new FileStreamResult(Stream.Null, "image/jpeg")); } }
public IActionResult Get(int id) { string content; try { content = JsonConvert.SerializeObject(DiagnosisData.Get(id)); } catch (Exception) { return(NotFound(id)); } return(Content(content, "application/json")); }