Better/easier way to save N:N relationships?

Topics: Core, General, Troubleshooting, Writing modules
Mar 2, 2012 at 4:09 PM

I'm working on parts that have N:N relationships right now, and it's tedious to have to write the code to save the relationship records the way it is demonstrated in the N:N relationship Orchard doc. 

I'm new to NHibernate so please pardon if this is a stupid question, but shouldn't NHibernate be able to automatically handle saving this relationship for us? 

Mar 3, 2012 at 1:28 AM

It does once you've set it up ;)

You might want to take a look at the science project...

Mar 3, 2012 at 1:49 AM
Edited Mar 3, 2012 at 1:49 AM

By setting it up I suppose you mean the very work I'm complaining about :) ? I always thought nhib would have some way to just look at the relationships between objects and persist them the same way it handles auto saving just a standalone object. Is that possible, and if so, would we just need to extend Orchard to set up the mappings for this to happen? 

I'll take a look at Science Proj soon. I need to chill on trying new stuff for a few days though. The past few have been 98% troubleshooting issues trying new things. 

Mar 3, 2012 at 7:54 AM

Well, I don't know if we "just need" to do that, but if you want to give a try, by all means go for it.