I'm setting a CreateFilteredQuery with IQueryable Interface. I have to return an IQueryable value but I'm getting IOrderedQueryable through an OrderBy function. Is there any way to copy all sensible data (not format from order and those unnecesary data) with that order into an IQueryable one?
I have tried almost everything. I can't change the return value because the functions is also for another "filters".
I'm trying to sort a column that is originally a String Column but is filled with numbers, so I have to parse into Int and then, orderby. (If I don't do that, if I order the result will be like: 1 2 20 22 3 instead of 1 2 3 20 22)
I created "tareas" with base.CreateFilteredQuery(input)
, and I'm trying to order by externalId before parsing to int
if (input.Sorting == "externalId asc")
{
var tareasOrdenadas = (tareas.ToList()).OrderBy(t => int.Parse(t.ExternalId));
return tareasOrdenadas;
}
I expect the output of System.Data.Entity.DbSet
or IQueryable
. Until this moment I had System.Linq.OrdenedEnumerable
or just simply IOrderedEnumerable
PD: When I modify "tareas" in other filters, I have a "System.Data.Entity.Infrastructure.DbQuery value for System.Linq.IQueryable type"
I need an IQueryable type, not an IOrderedEnumerable, AsQueryable() doesn't works
PD2: Thanks you all for the help. Sorry about no replies, I was out of the office for a few days. I'll try all you give to me, thanks you all.
Happy Coding