private void FillGridIngredients() { DataTable dt = Convert_Lists.ConvertTo <Ingredients>(_serv.GetAll()); gridIngredients.DataSource = dt; gridIngredients.Columns["Id"].Visible = false; gridIngredients.Columns["Name"].HeaderText = "Nome"; gridIngredients.Columns["IsValid"].HeaderText = "Valido"; gridIngredients.Columns["Quantity"].Visible = false; }
public ActionResult <IEnumerable <Ingredient> > GetAll() { try { return(Ok(_service.GetAll())); } catch (System.Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <IEnumerable <Ingredient> > GetAll() { try { IEnumerable <Ingredient> ingredients = _service.GetAll(); return(Ok(ingredients)); } catch (Exception e) { return(BadRequest(e.Message)); } }