c# - Filtering a graph of entity framework objects -


I'm just trying to filter out the results given by EF in those relevant - one year in the example below (Formatted Era) and an Ordered (filtOrder)

I have a simple objects set for them

People 1-M Orders 1-M Ordering

With these relationships already defined in Model.edmx

in SQL I will do something like this ...

Orders can be sent from inside Select from being taken. POOPLE_RECNO = PEOPLE.RECORD_NUMBER Internally on ORDERLINE join ORDERLINE .ORDER_RECNO = ORDERS.RECORD_NUMBER where ORDERLINE.SERVICE_YEAR = @ formatted year and ORDERS.ORDER_KEY =@filtorder

I have tried some approaches. ..

  var y ("order"). ("This. Operator.operator. SRROCEREER = '" ("Order"). + Formatted Era + "' '); Exx = (_entities.PEOPLE) hp.RECORD_NUMBER on hp.RECORD_NUMBER are included in _entities.ORDERS Ho.PEOPLE_RECNO at ho.RECORD_NUMBER is equal to ol.ORDERS_RECNO in joining ol in _entities.ORDERLINEs (where formattedYear == ol.SERVICE_YEAR) & amp; (Ho.DordCike == filtOrder) HP Select);  

y is not a member of transient.collection with ORDER_KEY ... and X is the right people who attach all of their orders on the returns I am doing only after my i

I think I am missing something simple?

Imagine that you are ordering a person of 100. Now you filter those orders below 10. In the end, you choose those orders that have those orders? There are 100 orders!

What you are asking is not a unit, because you do not want the whole unit. There is a subset of data from the unit. So the project is that: Go to HP = hp.ORDERS.Where (o = & gt; o.ORDER_KEY == filtOrder & amp; amp; O.ORDERLINES. Any (OL Language = & gt; ol.SERVICE_YEAR == formattedYear)) where ho.Any () is selected on the new {id = hp.id, names = hp.Name, // etc.} New selection in ho {// whatever};


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? -