linq - include keyword not providing filter with extension method -


I want to use the keyword with some selection like this:

  context Categories (C => c.products)   

I searched the Internet and found the following method:

  Public static class ObjectQueryExtension {public Fixed ObjectQuery & lt; T & gt; Include & lt; T & gt; (This objectivity should include & lt; T & gt; Mainclline, Expression & lt; Func & lt; T, Object & gt; & gt; subselector) {mainQuery Include (Subscriber Options as Sub-Selector.) System. Reflection.PropertyInfo) .name); }}   

When I pasted this project in my project and when I was typing

  context.category.include () //   

So it's just looking like the parameter to use the string:

  context.category.include (""); // like this   

I want to use keywords like this:

  context.Categories.Include (c => c.products )   

Can any organization tell me about this problem ???

You have to enter the property in this extension as a string Method:

 < Code> context.category.include ("Products");   

Include dafault () of System.Data.Entity also takes the string path:

  Public goods & lt; T & gt; Include (String Path)   

You can refer to

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

python - 'NoneType' object is not callable using 'find_all' in BeautifulSoup -