Save master detail

2010-02-09 Thread Larini
Hi, I want to know if I can save the master register and all its children with just one save(), just like: Father f = new Father(); Child c1 = new Child(); Child c2 = new Child(); f.children = new ListChild(); f.children.add(c1); f.children.add(c2); f.save(); So, I changed my relation to:

Re: Save master detail

2010-02-09 Thread Jason Meckley
Try setting inverse to true. I'm not sure what the AR syntax looks like, but with NH mappings it would look like this: bag name=children cascade=save-update inverse=true many-to-one type=Child/ /bag I would also recommend encapsulating the Child collection within the Father class. I usually do

Re: Save master detail

2010-02-09 Thread Larini
Hi Jason, the Invert works. So I try to insert another child to father and save again. The commands now was: 1 insert 3 updates in the old childs.. this 3 updates is not necessary. Thanks, Jason Meckley wrote: Try setting inverse to true. I'm not sure what the AR syntax looks like, but with

Re: Save master detail

2010-02-09 Thread Jason Meckley
once the father is saved, you should not need to explicitly call save again. You may also need to associate the child to the parent, otherwise AR (NH) will be updating the relationship each time. object id; using(var tx = session.BeginTransaction()) { var f = new Father(); id =

Re: Save master detail

2010-02-09 Thread Larini
Many thanks. One last thing, do you know a good tutorial documentation about castle AR ? Jason Meckley wrote: once the father is saved, you should not need to explicitly call save again. You may also need to associate the child to the parent, otherwise AR (NH) will be updating the

RE: Inject dependencies in custom validator attribute

2010-02-09 Thread G. Richard Bellamy
#1: you return true to SupportsBrowserValidation, which can't be right, since you're calling a service which can really only be Server-Side, since it's accessing the persistence layer of your Model. #2: the ValidationAttribute(s) have no knowledge of the container unless you supply that

Re: Inject dependencies in custom validator attribute

2010-02-09 Thread João Paulo Marques
I think you could use http://commonservicelocator.codeplex.com/; for this since otherwise you couldn't access the container. On Feb 9, 6:28 am, Yannis yannis.psar...@gmail.com wrote: Hi all, I have spent over 2 days on this and havent found a good solution so far so I think its time to ask

Re: Inject dependencies in custom validator attribute

2010-02-09 Thread Yannis
no i dont want to register it with the container - that would also not work. I could use the container or the common service location mentioned below but i dont want to couple the attribute with the process of looking up the service from some container. I want it to be a simple constructor

RE: Inject dependencies in custom validator attribute

2010-02-09 Thread G. Richard Bellamy
Of course others have written custom attributes. The problem is that you're trying to make attributes do something they're just not really designed for. Instead of approaching the problem from the attribute side, try coming at it from the Validator side. Take a look at the

Re: Inject dependencies in custom validator attribute

2010-02-09 Thread Alex Henderson
You can't use a constructor dependency, but you could use a property dependency, much the way you have to deal with action filters in asp.netmvc: http://weblogs.asp.net/psteele/archive/2009/11/04/using-windsor-to-inject-dependencies-into-asp-net-mvc-actionfilters.aspx

RE: Inject dependencies in custom validator attribute

2010-02-09 Thread G. Richard Bellamy
Oh sweet. I hadn't thought about that. that's much easier than my recent suggestion. From: castle-project-users@googlegroups.com [mailto:castle-project-us...@googlegroups.com] On Behalf Of Alex Henderson Sent: Tuesday, February 09, 2010 11:45 AM To: castle-project-users@googlegroups.com

ASP.NET MVC 1.0 + NHibernate 2.1 + Castle.Windsor

2010-02-09 Thread Leonardo Lima
Hi all, Anyone have an example to build an App using ASP.NET MVC 1.0 + NHibernate 2.1 and Castle.Windsor ? Thanks -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to

Re: ASP.NET MVC 1.0 + NHibernate 2.1 + Castle.Windsor

2010-02-09 Thread Krzysztof Koźmic
can you ask any broader question? Krzysztof On 2010-02-09 15:14, Leonardo Lima wrote: Hi all, Anyone have an example to build an App using ASP.NET MVC 1.0 + NHibernate 2.1 and Castle.Windsor ? Thanks -- You received this message because you are subscribed to the Google Groups Castle

Re: ASP.NET MVC 1.0 + NHibernate 2.1 + Castle.Windsor

2010-02-09 Thread Adam Toseland
What is the meaning of life??? Check out http://www.sharparchitecture.net/ ;-) 2010/2/9 Krzysztof Koźmic krzysztof.koz...@gmail.com can you ask any broader question? Krzysztof On 2010-02-09 15:14, Leonardo Lima wrote: Hi all, Anyone have an example to build an App using ASP.NET

Re: ASP.NET MVC 1.0 + NHibernate 2.1 + Castle.Windsor

2010-02-09 Thread Jason Meckley
3 different technologies solving 3 different problems, used together to create an application. If you understand how to use each framework independent of the others it's just matter of tying the 3 together. which become simple, once you understand the frameworks. On Feb 9, 4:29 pm, Adam Toseland

Re: ASP.NET MVC 1.0 + NHibernate 2.1 + Castle.Windsor

2010-02-09 Thread Markus Zywitza
Billy McCafferty has; he calls it Sharp Architecture, as Aunt Google would have told you on simply pasting your question there... -Markus 2010/2/9 Leonardo Lima goo...@leonardolima.com.br: Hi all, Anyone have an example to build an App using ASP.NET MVC 1.0 + NHibernate 2.1 and

Re: Windsor LifestyleType.Thread and ThreadPool

2010-02-09 Thread Blair
Stefann On Feb 8, 6:09 pm, Stefan Sedich stefan.sed...@gmail.com wrote: I ended up creating a custom lifestyle and used the CallContext for storage instead of using Thread.SetData like the Thread lifestyle manager does. Seems to work with no issues for me at the moment.

Re: Active Record Session Management

2010-02-09 Thread Markus Zywitza
Trunk has a brand-new feature called IConversation for session management in GUIs. Docs: http://using.castleproject.org/display/AR/Using+the+Conversation+Pattern -Markus 2010/2/10 Blair system.predic...@gmail.com: Hi I would like to know how best to use Active Record with a Repository