locked
Unidirectional Association in EDM RRS feed

  • Question

  • Dear Developer Team,

    Entity Framwork does not allow creating an unidirectinal association (At least I don't see any possibility to do it). If a database is designed to by in third normal form, it happens often that some tables like "type of some kind" are referenced multiple times (in my databases up to 50 times). In this case it makes no sense having the possibility to navigate from the "type" information to all the 50 entities which are using this type.

    I read in an artical that it seams to be possible defining something like a one way association using the Relationship Manager as a workaround. But developers shall be able to define that using the normal edmx-Editor.

    Regards
    Rolf
    Sunday, December 28, 2008 2:53 PM

Answers

  • Hello Rolf,

     It looks like we will, in the end, be able to put navigation property deletion in the final release of the designer, so you will not need to go trolling about in the model XML.

     Cheers,
       Noam
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, May 20, 2009 4:35 PM
    Moderator

All replies

  •  The designer team was hoping to add navigation property deletion to the next release, but it does not look like that feature will make it in. Your workaround for now is to just remove the navigation properties from the XML definition of the entitype. The association will still be two way, as all associations are in EF, but navigating it in the "reverse" direction will become a non-trivial task.

    HTH,
      Noam
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, January 13, 2009 8:44 PM
    Moderator
  • Hi Noam,
    Thanks for your replay. This sounds not really good to me. Especially because you talk about modifiying the XML definition by editor? I make currently bad expirience about updating the modell from the database using the context menu and then correcting some parts of the generated code, because of wrong generation.

    Regards
    Rolf
    Wednesday, January 14, 2009 9:52 PM
  • Hello Rolf,

     It looks like we will, in the end, be able to put navigation property deletion in the final release of the designer, so you will not need to go trolling about in the model XML.

     Cheers,
       Noam
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, May 20, 2009 4:35 PM
    Moderator