|
|
|
namespace BBWYB.Common.Extensions
|
|
|
|
{
|
|
|
|
public static class ConverterExtensions
|
|
|
|
{
|
|
|
|
public static long? ToInt64(this object? o)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
return Convert.ToInt64(o);
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int? ToInt32(this object? o)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
return Convert.ToInt32(o);
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|