c# - LINQ to Entities - limiting included tables -


Using two tables with one to many relationships (like make -> models), I made a built-in IQueryable function Model children in?

When I'm in "Camry" as a variable, I only want to return to a Toyota Make with kids called "Carrie", not all the kids, in fact, this SQL Want to recreate the statement:

Select
 , Leave on Model from MakeName, ModelName.  

So far the LINQ statement will look like this:

  Return to it. Object contact Make. ("Model"). Where (make => .modelnameEnglish ("camry")  

This is clearly not correct in formative form, because in the model where there is an entity collection and There is no .modelName property in it

How do you limit the tables involved? Is this possible in LINQ units?

Note, this is far from the top of my head, and I did not bother to compile so that could be a little bit Is:

  this return. ObjectContext.Make.Include ("model"). Where (make => make model any. (Model => model.modelname == "Camry"))  

Also note that I will not have "model" in the ink "model"

edit:

I did not understand the question correctly here you want to ask:

  return it. Include model contact ("make"). Where (model => .modelName == "Camry")  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -