>I forgot to include the where clause:
public virtual IEnumerable< T> GetAll(params string[] includes)
> {
> DbQuery query = _dbSet;
> foreach(x in includes)
> query = query.Include(x);
>
> var retVal = query.Where(entity => entity.condition);
> return retVal;
> }
>
>I don't know whats in your Adapter or Repository class, so I can't tell you where the code should be added. That is something best left to you and your coworkers.
>
>If you want to return only 2 or 3 columns, you need to add a Select clause and create a new instance of a different model, an anonymous object, or a dynamic object.
This is all seems to be too complicated :(
I think that actually this method is executed:
public PagedResult<ItemTree> GetPagedRequest(QueryRequest queryRequest)
{
queryRequest.FilterInfo.Filters.Add(new FilterItem { Field = "parent_id", Operator = "==", Value = 0 });
return _itemTreeRepository.GetPagedRequest(queryRequest);
}
So, since it had TO DO I hope my change is going to work here.
The problem is that it returns ItemTree entity which has too many columns. All the models are actually auto-generated using EDMX and run custom tool method.
So, suppose I wanted to create an ItemTreeSimple model (or something along the lines), I am not exactly sure where to add this simple model.
If it's not broken, fix it until it is.
My Blog