Horje
c# nullable generic Code Example
c# nullable generic
static void Main(string[] args)
{
    int? i = GetValueOrNull<int>(null, string.Empty);
}


public static Nullable<T> GetValueOrNull<T>(DbDataRecord reader, string columnName) where T : struct
{
    object columnValue = reader[columnName];

    if (!(columnValue is DBNull))
        return (T)columnValue;

    return null;
}




Csharp

Related
c# async constructor Code Example c# async constructor Code Example
how to disable device guard or credential guard vmware Code Example how to disable device guard or credential guard vmware Code Example
c# string console readline array Code Example c# string console readline array Code Example
c# int to string date conversion Code Example c# int to string date conversion Code Example
check if two timespans intersect c# Code Example check if two timespans intersect c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11