What I'm trying to do is get object data from session.
Code below should make clear all:
//Type of object which i need to get in runtime
Type someUnknownType = typeof(someObject);
int id = 1; // for example
// here i got error cannot resolved someUnknownType
ISession.Get<someUnknownType>(id);
How can I do that?
Edit:
someObject
is instance variable.
You need to use this Get method:
Here is an example from the NHibernate documentation:
First, you have a mistake:
someObject
is an instance variable, you can't calltypeof(someObject)
. You can only callsomeObject.GetType()
Have you tried to use non-generic version: