Geeks With Blogs
Sean's Blog My Development Blog September 2011 Entries
Converting Nullable Values to Their Default, Non-Nullable Values
If you've ever needed to convert a Nullable<T> type to its default, non-nullable value when its nullable value is null, here's a handy extension method to help you out.

public static T NullableToValue<T>(this T? value) where T : struct { return value ?? default(T); }

Posted On Tuesday, September 13, 2011 2:45 PM

Copyright © Sean Fao | Powered by: