persisting via a cascade using References

depaulo's Avatar

depaulo

29 Oct, 2010 10:27 AM via web

The application we have written is using Udi Dahan's 'persistence by reachability' pattern here.
http://www.udidahan.com/2009/06/29/dont-create-aggregate-roots/

This works nicely because we cascade add on all the one-to-many relationships and never have to specifically add anything to a repository. In fact our repository.add method is marked as obsolete.

However I am now in the situation where I want to cascade-all on a references relationship. I have a Company and it has a Logo (another entity) and I cant get it to cascade add the Logo entity when company.Logo = new Logo() is set.

I think I must be missing something obvious as References(x=>x.Logo).Cascade.All() doesnt add the logo to the database.

Anyone have any ideas?

Many thanks.

  1. 2 Posted by depaulo on 29 Oct, 2010 11:54 AM

    depaulo's Avatar

    SORRY!!!! It turns out that fluent nhib is cascade adding but I seem to have some structuremap session management issues which are stopping it working. Apologies.
    If I figure out which bit of my SM configuration is breaking it I will post up what it was.

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What day comes after Monday?