Stumped on Entity Framework & Lambda Expressions -
I understand that the compiler does not like this statement getting the error
Lambda expression is called 'System.Func & lt; MyData.Models.SomeModels, bool & gt; Because some return type Representative type type in the block
My details are going through my repository class
var Qry = repositoryClass.Find (c = Gt; c.Categories.Where (D = & gt; D. Division parentID == typewrite));
Find the Repository Class Method
Public INIM Marketplace & lt; SomeModels & gt; Find (Fax & lt; SomeModels, bool & gt; exp) {Return from curl in _db.SomeModels, select EX option); }
To work with the EF, you get an expression < ... & gt;
, where
:
public IEnumerable & lt; SomeModels & gt; Applicable with (as an estimate) (expression & lt; Func & lt; SomeModels, bool & gt; & gt; expand) {return _db. Some models Where (f); }
Then you will call it like this:
var qry = repositoryClass.Find (c => c.CategoryParentID == typeID);
Lambda's translation expression & lt; ... & gt;
.
If your setup is more complex, please clarify
Comments
Post a Comment