Reputation: 1835
We use NHibernate as our ORM. For the retrieval of most instances
session.Query<T>()
is just fine. How ever we have some instances where we want to specify the type during execution and pas it as a regular parameter something like:
session.Query(System.Type type)
Is this possible and if so what is the syntax?
Upvotes: 1
Views: 275
Reputation: 125488
You can't specify the type like that with Session.Query<T>()
.
You can use Session.CreateCriteria(typeof(type));
and then use the Criteria API.
Upvotes: 2