On Aug 29, 6:52 pm, Niclas Pehrsson <[email protected]> wrote: > > But when I connect the category and article when saving? How should my > approach be? I do not wan't any category.Articles.Add(article); because I dont > wanna load all my entities when just adding a new entity so a perfect > solution would be ArticleService.Save(Article article, Category > parentCategory); and it will save the connection for me but how? > I could use an mappingclass but it will give me an many-to-many > connection table which I do not prefer, other best practises? >
I don't understand why you would have to load all your entities in this scenario. If you want a many-to-many relationship, I think you will require a 'connection table' in you database. However, you don't need an NH mapping file for this connection table. http://codebetter.com/blogs/peter.van.ooijen/archive/2008/05/29/nhibernate-many-to-many-collections-or-mapping-is-not-one-table-one-class.aspx --Stuart --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
