Vote count:
0
The parameter 'p' was not bound in the specified LINQ to Entities query expression.
The goal is to create an Entity Filter that can contain other Entity Filters.
//Called from another function in this class. q is an IQueryable<Entity>
q = q.Where(GetPred());
//a function in the same class as the previous statement.
public Expression<Func<Entity, bool>> GetPred(){
var pred = PredicateBuilder.True<Entity>();
//No Problems with any line that is similar to this
pred = pred.And(p => this.Manufacturer.String == p.Manufacturer);
//here is where i am having issues Any time a query is called here it blows up
//when i do GetFirstOrDefault
//SomeChildModel is another model like the current class
var ChildPred = this.SomeChildModel.GetPred();
pred = pred.And(p => ChildPred.Invoke(p.SomeChildEntity));
//it doesn't necessary blow up right here. But adding this causes my error.
//I would like to mention, i have spent the last 3 hours trying everything i
//can understand from StackOverflow and other sources. Nothing i have tried
//is working. I am sure i am missing something Very simple here.
}
Please let me know if I forgot any important information you might need to help answer this question.
asked 4 mins ago
LinqKit -> The parameter was not bound in the specified LINQ to Entities query expression
Aucun commentaire:
Enregistrer un commentaire