I have got the list of Class Name as Follows:
Type[] typelist = typeof(Sample.Students).Assembly.GetTypes();
now i have complete list of all classes available in Sample NameSpace:
Now i want to get data through class
I am using Devexpress Persistance class
so basically i have to create XPQuert Object as follows:
XPQuery<Employee> EmployeeQuery = new XPQuery<Employees>(XPODefault.Session);
but in my case Employee class will be listed in typelist variable..
How can i create the object of XPQuery.. is it possible something like this:
XPQuery<typeof(typelist[0].Name)> EMployeeQuery = new XPQuery<typeof(typelist.Name)> (XPODefault.Session);
i meant i want to create object dynamically.. how can i do
Thanks..
You can do something like:
And then use it as:
Of course you will NOT be able to have a nice XPQuery as you don’t know the type at the compile time, but you still can have an IQueryable to start from.