예제 #1
0
        //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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        // 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);
        }
예제 #4
0
 public PlatosController(PlatosRepository repository)
 {
     _repository = repository;
 }
예제 #5
0
        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);
        }
예제 #6
0
        // P L A T O S

        public List <Plato> AllPlatos([Service] PlatosRepository repo) =>
        repo.GetPlatos();