How to check if the object is byte[]
using a reflection? I use this line of code to check typeof(T).GetType().Equals(typeof(byte[]))
but it didn't work it out for me. Is this achievable?
public static SetSqlDbType<T>()
{
switch(Type.GetTypeCode(typeof(T)))
{
case TypeCode.Int64:
return SqlDbType.BigInt;
// ... some more cases
case TypeCode.Object:
{
if (typeof(T).GetType().Equals(typeof(byte)))
{
return SqlDbType.VarBinary;
}
}
}
}