you need an NH aware data binder. I think there is something out there somewhere.
Personally, I would have used a DTO as the action's parameter, and then map it to a domain entity (NH powered). On Sat, Jun 13, 2009 at 6:36 PM, Lucio <luciolu...@gmail.com> wrote: > > I have an "Add Product" page in which there is a selection list of > categories, you should pick one. The SmartDispatcherController will > push inside my Product/New action the equivalent to this: > > productFromSmartDispatcher = new Product { > Category = new Category { Id = 1 }, > Name = "Product Name" > } > > I have to reload by PK afterwards to avoid the "Object with same Id > already in session" error: > > product.Category = s.Load<Category>(product.Category.Id) > > Is there a cleaner way to do this or is it just the way the Dispatcher > works? > > Thanks > Lucio > > > > -- Ken Egozi. http://www.kenegozi.com/blog http://www.delver.com http://www.musicglue.com http://www.castleproject.org http://www.gotfriends.co.il --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---