Exemplo n.º 1
0
        public ResponseApi <List <SecurityDTO> > Get(SecurityQueryFilter filters)
        {
            //obtenemos IEnumerable
            var list = _entity.AsEnumerable();

            //aplicamos filtros
            if (filters.SecurityId != null)
            {
                list = list.Where(x => x.SecurityId.Equals(filters.SecurityId));
            }
            if (filters.RoleId != null)
            {
                list = list.Where(x => x.RoleId.Equals(filters.RoleId));
            }
            if (filters.User != null)
            {
                list = list.Where(x => x.User.Contains(filters.User));
            }
            if (filters.Name != null)
            {
                list = list.Where(x => x.Name.ToLower().Contains(filters.Name.ToLower()));
            }
            if (filters.Active != null)
            {
                list = list.Where(x => x.Active.Equals(filters.Active));
            }

            return(GetPagedList(list, filters));
        }
Exemplo n.º 2
0
        public IActionResult GetSecuritys([FromQuery] SecurityQueryFilter filters)
        {
            var response = _Security.Get(filters);

            return(Ok(response));
        }