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
Post a Comment