maybe try this :
public IList<T> Get<T>(string propertyName, object propertyValue)
{
return this.session.CreateCriteria(typeof(T))
.Add(NHibernate.Criterion.Restrictions.Eq(propertyName,
propertyValue))
.List<T>();
}
or maybe even
public IList<T> Get<T>(string propertyName, object propertyValue)
{
return this.session.CreateCriteria<T>()
.Add(NHibernate.Criterion.Restrictions.Eq(propertyName,
propertyValue))
.List<T>();
}
(this is notepad code, untested, uncompiled, and unmanaged (ha ha ) )
On Tue, Jan 13, 2009 at 3:52 PM, Kris-I <[email protected]> wrote:
> Hello,
>
> I'd like use the same method for several type, I have this
>
> I have this
>
> public IList<myType> Get(Type myType, string propertyName, object
> propertyValue)
> {
> return this.session.CreateCriteria(myType)
> .Add(NHibernate.Criterion.Restrictions.Eq(propertyName,
> propertyValue))
> .List<myType>();
> }
>
> I have 2 erros : type our namespace "myType" could not be found.
>
> Could you help me ?
>
> Thanks,
>
> >
>
--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---