You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
790 B
33 lines
790 B
using System;
|
|
namespace Tiobon.Core.Common.DB.Dapper;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public static class UtilConvert
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="thisValue"></param>
|
|
/// <returns></returns>
|
|
public static string ObjToString(this object thisValue)
|
|
{
|
|
if (thisValue != null) return thisValue.ToString().Trim();
|
|
return "";
|
|
}
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="thisValue"></param>
|
|
/// <returns></returns>
|
|
public static bool ObjToBool(this object thisValue)
|
|
{
|
|
bool reval = false;
|
|
if (thisValue != null && thisValue != DBNull.Value && bool.TryParse(thisValue.ToString(), out reval))
|
|
{
|
|
return reval;
|
|
}
|
|
return reval;
|
|
}
|
|
}
|
|
|