I have a number of calls for the same query but with slightly different WHERE
clause, does anyone know if it's possible to pass a variable as the column name as I can't seem to acheive it.
I know the below isn't correct but just to give you an idea of what i'm trying to acheive.
public EmailUserListViewModel EmailUserListData(int CaseId, string ColumnName)
{
CaseId = CaseId,
EmailUserList = (from u in efContext.PgsUsers
where ColumnName == true
orderby u.FirstName, u.LastName
select new EmailUserListModel
{
UserId = u.Id,
Name = ((u.FirstName == null) ? "" : u.FirstName)
+ ((u.LastName == null) ? "" : " " + u.LastName),
Email = u.Email,
Checked = false
}).ToList()
};
}