C# check any type null

You can use this to check null

 public static bool CheckNullOrEmpty<T>(T value)  
 {  
    if (typeof(T) == typeof(string))  
     return string.IsNullOrEmpty(value as string);  
    return value == null || value.Equals(default(T));  
 }  

Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report