I need to determine if System.Type
is assignable from list of generic constraints at runtime.
// Example
Type type = typeof(int);
// Generic constraints to check
// unmanaged, IComparable, IFormattable, IConvertible, IComparable<T>, IEquatable<T>
bool isAssignable = IsAssignable(type);
Aucun commentaire:
Enregistrer un commentaire