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;
}
Also in C#:
- unity set position
- unity resources load
- how do i foreach c#
- wpf label text in center
- list c#
- redirect to https codeigniter
- how to delete from a list c#
- singleton unity
- How to search for a string from readline in c#
- c# list to string comma separated
- .net core session
- c# read file stream
- declare string array c# without size
- What is a class in c#
- how to use variables in c#
- unity material offset script
- c# random string
- change sprite of gameobject unity
- c# mongodb update multiple fields
- resize image c#
- How to set an expiry date on a program
- c# reverse list
- button color uwp c#
- install .net sdk ubuntu 20