Add a conditional where clause to LINQ Query
Fetching all users
var query = from u in context.users
select u;
Add a condition to filter it by user
if (Selected)
query = query.Where(u => u.user_id == userID);
Fetching all users
var query = from u in context.users
select u;
Add a condition to filter it by user
if (Selected)
query = query.Where(u => u.user_id == userID);