public IHttpActionResult ObteneIngredientes() { try { IngredientesNegocio auxIngrediente = new IngredientesNegocio(); List <Ingrediente> ingrediente = auxIngrediente.ObtenerIngredientes(); Response response = new Response { Code = 200, Message = "Ingredientes", Data = ingrediente }; return(Ok(response)); } catch (Exception ex) { Response response = new Response { Code = 400, Message = ex.Message }; return(Ok(response)); } }
public IHttpActionResult ActualizarIngrediente(Ingrediente ingrediente) { try { IngredientesNegocio auxIngrediente = new IngredientesNegocio(); string message = auxIngrediente.ActualizarIngrediente(ingrediente); Response response = new Response { Code = 200, Message = message }; return(Ok(response)); } catch (Exception ex) { Response response = new Response { Code = 400, Message = ex.Message }; return(Ok(response)); } }
public IHttpActionResult EliminarIngrediente(int id) { try { IngredientesNegocio auxIngrediente = new IngredientesNegocio(); string mensaje = auxIngrediente.EliminarIngrediente(id); Response response = new Response { Code = 200, Message = mensaje }; return(Ok(response)); } catch (Exception ex) { Response response = new Response { Code = 400, Message = ex.Message }; return(Ok(response)); } }