how can i make a collection that can store a data type (say string, datetime, decimal, etc..)? and that use this collection to perform comparison as such:
if (pi.PropertyType.IsIn ([how can check against the collection of type) //where pi is a property info]))
{
}
any suggestions?
List<Type> types = new List<Type> {typeof(string), typeof(int)};
if (types.Contains(pi.PropertyType))
{
//do stuff
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With