how exactly do you expect a Future to work over a webservice with marshalling 
in between? You should rethink your context boundaries - usually when crossing 
an AppDomain boundary you should already have all data you need in place and 
ready for marshalling them. Any form of lazy evaluation will hardly work over 
the wire

-Erich

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of mhnyborg
> Sent: Sunday, July 26, 2009 11:41 PM
> To: nhusers
> Subject: [nhusers] Future<T> is not playing nice with web-services
> 
> 
> First I love how easy it is to use Future<T> but I think it's only
> half baked. or put in another way only implemented for server side
> code that is not returning a list.
> 
> I have this code that's is returning a lot of simple catalogs for
> comboboxes
> 
> OperationContract]
> public CatalogsForSite GetCatalogsForSite()
> {
> CatalogsForSite catalogsForSite;
> using (var s = sessionManager.OpenSession())
>  {
>       var stypes = s.CreateCriteria(typeof
> (ServitudeType)).Future<ServitudeType>();
>       var ptypes = s.CreateCriteria(typeof
> (ProtectionLineType)).Future<ProtectionLineType>();
>       var cSysTypes = s.CreateCriteria(typeof(CSys)).Future<CSys>();
>       var coordinatPrecissionTypes = s.CreateCriteria(typeof
> (CoordinatPrecissionType)).Future<CoordinatPrecissionType>();
>       var levelPrecissionTypes = s.CreateCriteria(typeof
> (LevelPrecissionType)).Future<LevelPrecissionType>();
>       var siteTypes =
> s.CreateCriteria(typeof(SiteType)).Future<SiteType>
> ();
>       There is more ....
> 
>       // this is done to make NH do the querys. DO this while the
> session
> is open
>       var c = stypes.Any();
> 
> 
>       catalogsForSite = new CatalogsForSite
>  {
>       StdNotes = stdNotes,
>       SiteStatus = siteStatus,
>       Phases = phases,
>       ProbabilityTypes = probabilityTypes,
>       SystemTypes = systemTypes,
>       RevisionTypes = revisionTypes,
>       EnvironmentClassifications = environmentClassifications,
>       ProjectClassifications = projectClassifications,
>       MilestoneHolidays = milestoneHolidays,
>       There is more ...
> }
> 
> }
> 
> return catalogsForSite
> }
> 
> The problem is that Future<T> is returning
> NHibernate.Impl.DelayedEnumerator and that is not a type expected by
> the webservice.
> If the result on the DelayedEnumerator class was public then maybe I
> could use that.
> 
> Hope to get some help with this.
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to