locked
Can an EntitySet contain an EntitySet? RRS feed

  • Question

  • It looks like an EntitySet contains NavigationLinks and EntityTypes. But can an EntitySet contain an inner EntitySet? The docs say that an EntitySet is a set of Entities which makes me think that an EntitySet cannot contain another EntitySet.

    Which means that entity sets are flat. You can have depth in terms of complex types and navigation links but entity sets themselves are just a single set in the root with links providing relationships which can be viewed as depth.

    On the flip side, if this is allowed is there a sample OData service that has this?

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Wednesday, January 9, 2013 5:49 PM

Answers

  • You are talking about a feature that the odata team often refers as "Containment". For e.g. If you think about Customers and Orders entity set, there is no top level Orders entity set. The orders can be accessed only via the customer instance. Is that what you are talking about? If not, can you please explain your scenario in little more detail?

    If this is the feature you are talking about, we support this in the protocol. We haven't got to implementing this in WCF data services stack yet.

    Thanks

    Pratik


    This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by DavidThielen Thursday, January 10, 2013 5:25 PM
    Thursday, January 10, 2013 5:08 AM
    Moderator

All replies

  • You are talking about a feature that the odata team often refers as "Containment". For e.g. If you think about Customers and Orders entity set, there is no top level Orders entity set. The orders can be accessed only via the customer instance. Is that what you are talking about? If not, can you please explain your scenario in little more detail?

    If this is the feature you are talking about, we support this in the protocol. We haven't got to implementing this in WCF data services stack yet.

    Thanks

    Pratik


    This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by DavidThielen Thursday, January 10, 2013 5:25 PM
    Thursday, January 10, 2013 5:08 AM
    Moderator
  • It hit me as I was reviewing our code. I realized that we had code for an EntitySet to contain an EntitySet, but that code had never been executed. I read the spec and I think as it's specified that is not allowed. So I just wanted to confirm and we'll then pull that never executed code.

    I have no opinion as to if this would be a good idea - you guys know much better than me. I just wanted to check. I'll take your answer as a no at present.

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Thursday, January 10, 2013 5:25 PM