Here's a generic NHDataBinder: http://using.castleproject.org/display/MR/Generic+NHDatabind
On Jun 13, 4:38 pm, Lucio <[email protected]> wrote: > The DTO approach sounds very nice, thanks for the tip. > > On Jun 13, 3:19 pm, Ken Egozi <[email protected]> wrote: > > > > > 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 <[email protected]> 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/bloghttp://www.delver.comhttp://www.musicglue... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
