I currently have the below code to fetch data from my Entity framework model.
return db.Tasks.Where(t => (t.TaskStatuses.TaskStatusId.Equals(currentStatus) | currentStatus == -1) &
(t.Projects.ProjectId.Equals(projectId) | projectId == -1) &
(assignedToGuid == rnd | t.AssignedTo.UserId.Equals(assignedToGuid)));
I now want this to order the data, the function takes 2 stings OrderField and OrderDirection, is there anyway I can change my query to dynamically order by these variables?
Thanks