Inspect the following code:
public IEnumerable<Query> GetAllQueries_FilteredOnCurrentUsersInvolvement(User user)
{
var queries = _genericUnitOfWork.GenericRepository<Query>().Get(q =>
q.AuthorUserID == user.ID ||
q.ConsultantUserID == user.ID ||
q.CreatorUserID == user.ID ||
q.EngagementPartnerUserID == user.ID ||
q.EQCRPUserID == user.ID ||
q.LeadPartnerUserID == user.ID ||
q.RMPUserID == user.ID ||
(!string.IsNullOrEmpty(q.OthersInvolvedUserIDs) && q.OthersInvolvedUserIDs.Split(',').Contains(user.ID.ToString())),
includeProperties: "NatureOfQuery");
return queries;
}
It compiles just fine. But when you run the code:
{"LINQ to Entities does not recognize the method 'System.String[] Split(Char[])' method, and this method cannot be translated into a store expression."}
I could write the T-SQL code myself. How to make LINQ to Entities understand how to process this?
P.S> Would this nuget package be able to resolve this?
The suggested duplicate link, does not provide any answer how to resolve this issue. So no that did not answer this question.