Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
1.2.1
Hi, Is there a generice version of CreateCriteria?
I am trying to create generic repository and I need method like this
Code:
public EntityBag<T> FindByCriteria<T>( params ICriterion[] criterion) where T : EntityBase
{
{
ICriteria criteria = NHSession.CreateCriteria(????????);
foreach (ICriterion criterium in criterion)
{
criteria.Add(criterium);
}
//TODO : add extension method to criteria EntityBag<T> to criteria
return new EntityBag<T>( criteria.List<T>());
}