Beispiel #1
0
        public static IQueryable <T> GeraQueryParaGetAll(IServico <T> servico, IEnumerable <KeyValuePair <string, string> > chaveValor)
        {
            IQueryable <T> query;

            if (chaveValor.Count() > 0)
            {
                KeyValuePair <string, string> limite = chaveValor.First(x => x.Key.Equals("limite"));
                query = servico.PegarTodos(int.Parse(limite.Value));
            }
            else
            {
                query = servico.PegarTodos();
            }
            return(query);
        }