c# - Use a type generated from reflection as a generic type parameter? -


i getting type set string via

var resultingtype = type.gettype(stringoftype);  

and works giving correct type.

then using fluent-nhibernate database mapping try pull class (a table in database) so

repo.getqueryable<resultingtype>.where(e => e.id =1) 

i'm not sure if caliburn.micro important not let me call on resultingtype. doing wrong?

you should use reflection it, example:

var method = repo.gettype().getproperty("getqueryable").getmethod.makegenericmethod(resultingtype); 

then can use createdelegate or invoke - depends on needs.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

javascript - How to bind ViewModel Store to View? -

javascript - Solution fails to pass one test with large inputs? -