c# - lazy loaded NHibernate collections into ViewModels? -


I have hibernate mapping that is lazy loading = true. I have something in my client view model:

  foreach (_customerRepository in Customer C) {this.Customers.Add (New Single Custom Consumer Model (C)); }  

This clearly kills all lazy loading, because customers pass each other one by one.

How can I get my collections (sub-selections and sub-subcollections ASF) in the related Observation Collection of my View Models to bind the UI with the Model object?

It seems like there is a common problem, but I did not get any answers, neither here nor here on the googles ...

I am not sure I fully understood the question. But I was wondering why not your getCustomers method

  IEnumerable & lt; SingleCustomerViewModel & gt; Choose Singular CustomerViewModel (c) from C in GetCustomers () {_customerRepository; }  

Since LINQ expressions have been evaluated lightly, therefore, anesthetized collection will not be started until it is actually bound to the UI.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -