//MODIFICAR MUTATION public async Task ModificarIngredientes([Service] PlatosRepository repo, [Service] ITopicEventSender eventSender, int idPlato, int idCarne, int idVerdura, int idHarina, int idLacteo) { PlatoIngrediente editplatoIngrediente = await repo.ModificarIngredientesPlatoAsync(idPlato, idCarne, idVerdura, idHarina, idLacteo); await eventSender.SendAsync("Ingredientes plato modificado", editplatoIngrediente); }
public async Task <Plato> UnPlato([Service] PlatosRepository repo, [Service] ITopicEventSender eventSender, int id) { Plato platoPorId = repo.GetPlatoId(id); await eventSender.SendAsync("RetornaPlato", platoPorId); return(platoPorId); }
// CREAR MUTATION public async Task CrearPlato([Service] PlatosRepository repo, [Service] ITopicEventSender eventSender, int idPlato, String nombrePlato) { Plato newPlato = new Plato { Id = idPlato, NombrePlato = nombrePlato, }; var crearNewPlatos = await repo.CrearPlatoAsync(newPlato); await eventSender.SendAsync("Plato creado", crearNewPlatos); }
public PlatosController(PlatosRepository repository) { _repository = repository; }
public async Task <List <GrupoIngredientesViewModel> > ListaAlergenosPorPlato([Service] PlatosRepository repo, [Service] ITopicEventSender eventSender, int id) { List <GrupoIngredientesViewModel> alerLista = repo.ListaAlergenosPlato(id); await eventSender.SendAsync("Retornar Alérgenos", alerLista); return(alerLista); }
// P L A T O S public List <Plato> AllPlatos([Service] PlatosRepository repo) => repo.GetPlatos();