Pass a type into a function code example
Example 1: send type as argument c#
object GetColumnValue(string columnName, Type type)
{
// Here, you can check specific types, as needed:
if (type == typeof(int)) { // ...
Example 2: send type as argument c#
T GetColumnValue<T>(string columnName)
{
// If you need the type, you can use typeof(T)...