You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than add yet another parameter to the controller, is there any way to use L2QS to model bind an a filter for the activities collection? e.g.
public MyResponse(int ownerId, Func<Activity, bool> activitiesFilter) {
var owner = _owners.Single(o => o.OwnerId);
owner.Activities.RemoveAll(activitiesFilter);
return owner;
}
It would also be handy to be able to model bind Expression<Func<Activity, bool>> so I could pass it into a Queryable.
Or maybe is this already possible by doing a projection and mapping back to the original model type?
The text was updated successfully, but these errors were encountered:
mcintyre321
changed the title
Filters on sub-properties \ model binding a filter Predicate
Filters on sub-properties / model binding a filter Predicate
Aug 28, 2014
Hi Pete!
I've got a requirement to add take/skip/filter on a sub-property for an resource like this:
Rather than add yet another parameter to the controller, is there any way to use L2QS to model bind an a filter for the activities collection? e.g.
It would also be handy to be able to model bind
Expression<Func<Activity, bool>>
so I could pass it into a Queryable.Or maybe is this already possible by doing a projection and mapping back to the original model type?
The text was updated successfully, but these errors were encountered: