Hi guys, got the following environment.
* Desktop Application, using and enjoying NhibernateIntegration Castle (Latest
version, integrated with NHibernate 3.1.0.4).
* I use the MVC pattern.
My problem is: Lose the Lazy in the view.
Example situation:
Example situation:
Model
[Serializable]
public Person {
[Property (Column = "name")]
public virtual string Name {get; set;}
[ManyToOne (Lazy = Laziness.Proxy)]
Public virtual Address {get; set;}
}
Controller
public virtual IList <person> ListarPessoas () {
using (Session = sessionMananger.OpenSession ()) {
return Session.CreateCriteria<person>().List<person>();
}
}
View
...
var people = controller.ListPeople ();
foreach (Person person in people) {
AdicionarLinha (person.Name, person.Address.Street (***));
}
...
Note that in view (signposted ***), I need to use the Lazy, however, for
using the using, ismade to dispose the session at the end of the
controller method.
1 - How to create a scope of conversation? There is something to that effect
?
Following the Web model, each requisilção a session, this behavior does not
occur.
I hope you can help me.
--
*Samuel Pereira *
Analista de Desenvolvimento
--
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.