c# - Cast from generic class property -


i want cast generic class of propertytype , dont know how it.

i want this:

var key = expression.property(generictype, rule.comparisonpredicate); type propertytype = typeof(t).getproperty(rule.comparisonpredicate).propertytype;                                               var converter = typedescriptor.getconverter(propertytype); var value = expression.constant((propertytype)converter.convertfromstring(rule.comparisonvalue) ); 

but in line var value got error :

'propertytype' variable used type

you cannot cast variable, should specify real type

var value = expression.constant((propertytype)converter.convertfromstring(rule.comparisonvalue) );


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -