This question is locked. New answers and comments are not allowed.
I am attempting to build a dynamic LINQ query to filter users. Here is my code so far:
The problem I am having is that the where clause is not being applied to the LINQ query. If I set a username of 'blah' the linq query still returns all users regardless. What am I doing wrong?
Thanks
'Initialise the contextsDim portal As New Domain.vPortal.DbContext'Get the basic user searchDim search = (From u In portal.Users Select u)'Apply the filter criteriaIf Not filter.Name Is Nothing Then search.Where(Function(e) e.Username = filter.Name)End If'Get the resultsDim results = search.ToListThe problem I am having is that the where clause is not being applied to the LINQ query. If I set a username of 'blah' the linq query still returns all users regardless. What am I doing wrong?
Thanks