G
Guest
Given a class 'Invoice' with a property 'public IMyColl<IInvoiceLine>
InvoiceLines' where 'IMyColl<T> : IList<T>' i would like to detect by
reflection that 'InvoiceLines' is a 'System.Collection.Generic.IList'.
When performing something like: 'if
(typeof(IList<>).IsAssignableFrom(propertyInfo.Type))' where 'propertyInfo'
obviously refers to the 'InvoiceLines', the result is always 'false' because
indeed 'IList<object>' and 'IMyColl<IInvoiceLine>' are not type-related.
So, I would like something that restricts the checking to the 'list' part of
the type 'IMyColl<IInvoiceLine>', but cannot find it when exploring the
different properties of 'propertyInfo.Type'.
InvoiceLines' where 'IMyColl<T> : IList<T>' i would like to detect by
reflection that 'InvoiceLines' is a 'System.Collection.Generic.IList'.
When performing something like: 'if
(typeof(IList<>).IsAssignableFrom(propertyInfo.Type))' where 'propertyInfo'
obviously refers to the 'InvoiceLines', the result is always 'false' because
indeed 'IList<object>' and 'IMyColl<IInvoiceLine>' are not type-related.
So, I would like something that restricts the checking to the 'list' part of
the type 'IMyColl<IInvoiceLine>', but cannot find it when exploring the
different properties of 'propertyInfo.Type'.