Exemplo n.º 1
0
        public List <AllHistoryEventoViewModel> SearchEventAll(SearchEventAllViewModel model)
        {
            var listEvent = _eventPlusContext.Evento.Where(w => w.Nombre.Contains(model.Text)).Select(s => new AllHistoryEventoViewModel
            {
                Id              = s.Id,
                IdLogin         = _eventPlusContext.EventoUsuario.Where(w => w.IdEvento == s.Id).Select(w => w.IdLogin).FirstOrDefault(),
                Nombre          = s.Nombre,
                Descripcion     = s.Descripcion,
                FechaFin        = s.FechaFin,
                FechaInicio     = s.FechaInicio,
                IdTipo          = s.IdTipo,
                Tipo            = s.IdTipoNavigation.Nombre,
                ImagenMiniatura = s.Imagen,
                FechaRegistro   = s.FechaRegistro
            }).ToList();

            return(listEvent);
        }
Exemplo n.º 2
0
        public IActionResult SearchEventAll([FromBody] SearchEventAllViewModel model)
        {
            var user = _eventoService.SearchEventAll(model);

            return(Ok(user));
        }