using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Opsoft.NetCore.O3App.Shared { public static class Int16Ext { public static TOut ToEnum( this short value ) { var outputType = typeof( TOut ); if ( outputType.IsEnum ) { if ( outputType.IsEnumDefined( value ) ) { var obj = System.Enum.ToObject( outputType, value ); if ( obj != null ) { return ( TOut )obj; } } } return default( TOut ); } public static System.Int32 ToInt32( this short value ) { return Convert.ToInt32( value ); } } }