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?
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.