Here i pass a parameter named PId. Which will be compare with another table's PId. But i getting error when the query is binding query to ToList().
ERROR: "The specified type member 'PId' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported."
public IList<Models.MyModel> GetDaraByPId(Guid PId)
{
var query = this._Repository.GetIQueryable();
var list = query.Select(a => new Models.MyModel
{
MyModelId = a.Id,
MyModelName = a.Name
}).Where(f => f.PId == PId);
return list.ToList();
}