Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 807 Bytes

README.md

File metadata and controls

10 lines (7 loc) · 807 Bytes

ConverterHelper

Build status codecov NuGet version

Helper for easy and elegant type conversions, taking care of nullables, enums, System.DBNull and other types inherit from System.IConvertible. The method tries to convert to the specified type; if the conversion fails, there is an option to define a fallback value to be returned as a result.

Example:

int converted = someObject.ConvertToOrDefault(-1);