-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Strong typed collection and ObjectDatasource
PostPosted: Thu May 11, 2006 8:01 am 
Newbie

Joined: Tue Apr 04, 2006 4:47 am
Posts: 18
Hi,

Is there a good example or a standard way to provide strong typed collections for use with ObjectDatasource in .NET? Should I write wrapper classes for all classes that exist in my collections?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 12:31 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi!... in .NET 2.0... why don't you just use generics?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 1:34 pm 
Regular
Regular

Joined: Fri Feb 03, 2006 5:28 pm
Posts: 73
Location: Québec, QC, Canada
Does the current release support generics ? or you need to get lastest version from subversion and compile it ?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 6:13 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi!
Quote:
Does the current release support generics ? or you need to get lastest version from subversion and compile it ?


The current official NHibernate does [b]not/b[] support generics, but that wasn't IMO the intent of your original question... what you asked was:

Quote:
Is there a good example or a standard way to provide strong typed collections for use with ObjectDatasource in .NET?


Now... the ObjectDatasource is a .NET 2.0 component... and nothing prevents you from wrapping your "non-generic obtained from hibernate collection" in to a generic colection:

Code:
protected IList<TPonoType> GetTypedList(IList ponos)
        {
            IEnumerable<TPonoType> enumerable = (TPonoType[]) ArrayList.Adapter(ponos).ToArray(typeof (TPonoType));
            return new List<TPonoType>(enumerable);
        }


After all, you seem to need generics at the ObjectDatasource... don't you?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.