Your AccessRight seems to be a user defined function.
If that is the case, then you are stuck with calling context.Database.SqlQuery<T>(YourSQL) as EF doesn't support user defined functions.
UPDATE:
You asked What if you have the id list?. Assuming you have an ids list.
from c in Customer
where ids.Contains(c.Id)
select c
However, can't yet run the dbo.AccessRight(Id, 5) user defined function to show in your select result.
You actually can
Forgive my previous lack of knowledge. You can actually call user defined functions with EF.
Inside your Database context, you can do something like this (this code was actually generated by EF EDMX tool although I removed a few things for simplicity):
public virtual ObjectResult<usp_GetAppropriatenessQuestionsWithMetadata_Result> usp_GetAppropriatenessQuestionsWithMetadata(Nullable<int> languageId)
{
var languageIdParameter = languageId.HasValue ?
new ObjectParameter("LanguageId", languageId) :
new ObjectParameter("LanguageId", typeof(int));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<usp_GetAppropriatenessQuestionsWithMetadata_Result>("usp_GetAppropriatenessQuestionsWithMetadata", languageIdParameter);
}
dbContext.Database.Query<T>(sqlQueryString)whereTis the dto that represents anIdandAccessRightandsqlQueryStringis the sql you have provided