// GET: api/Categories/5 public CategoriaAPIModel Get(long?id) { var apiModel = new CategoriaAPIModel(); try { if (id == null) { apiModel.Message = "!OK"; } else { apiModel.Result = service.ById(id.Value); } } catch (System.Exception) { apiModel.Message = "!OK"; } return(apiModel); }