Lets say I have a property that IsRegistrationCompleted.
I have 2 checkboxes in my filter interface that says:
- Complete
- Incomplete
If both are checked, then both complete and incomplete users are retrieved. If just Complete is checked, just completed users are retrieved. If none are checked, none are retrieved.
How do I put this logic in linq?
I binded my checkboxes as follows:
public bool IsCompleted { get; set; }
public bool IsInCompleted { get; set; }
My method is:
private void GetUsers()
{
//TODO: Apply filters here.
var query = _context.GetUsers(); //Returns IQueryable<User>
_context.Load(query, LoadBehavior.MergeIntoCurrent, LoadApplicantsCompleted, null);
}
Using silverlight with WCF Ria Service.
In one query it will look like this: