3 Comments

  1. With all due respect, are you serious about that? Persisting a collection of value types (literals, components, aka. complex types) is def. the job of the (ORM’s) persistance manager, not the developer. Messing with OnSongTitlesChanged and OnObjectMaterialized like that means doing the EF’s job. Btw there is nothing “ideally” about “ICollection SongTitles, this is the way your domain is supposed to be. If the EF can’t cope with it, leave it allone.

    • David DeWinter

      Agreed that this post is a big workaround for exposing your entities in a way they are “supposed to be.” I simply present this method as an alternative in order to get part of the way there.

  2. Zeeshan Hirani

    I guess the removed worked in this case because its an identifying relationship where a child cannot exist without a parent. normally you have to mark an object for deletion as well or just delete which would remove it from the collection as well.
    By the way do u know if anything is being done in this area of EF to improve the experience.

Leave a Reply

Your email address will not be published. Required fields are marked *