A
Andrzej Kaczmarczyk
Hi
How to find out in templated class if a type is implementing an interface.
In particular I want to find out whether the type passed is a INullableValue
I came up with somethig like this:
class myClass<PropertyT>
{
public DoSomething() {
if ( typeof(PropertyT).GetInterface(typeof(INullableValue).ToString())
!= null ) {
// PropertyT is INullable
}
}
}
is there a simpler way?
CUIN Kaczy
How to find out in templated class if a type is implementing an interface.
In particular I want to find out whether the type passed is a INullableValue
I came up with somethig like this:
class myClass<PropertyT>
{
public DoSomething() {
if ( typeof(PropertyT).GetInterface(typeof(INullableValue).ToString())
!= null ) {
// PropertyT is INullable
}
}
}
is there a simpler way?
CUIN Kaczy