Browse Source

Add : UtilMethods.GetNativeSql

pull/31/head
sunkaixuan 2 years ago
parent
commit
f1ad5ac2bb
  1. 6
      Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs

6
Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs

@ -17,6 +17,12 @@ namespace SqlSugar
{ {
public class UtilMethods public class UtilMethods
{ {
public static string GetNativeSql(string sql,SugarParameter[] pars)
{
if (pars == null||pars.Length==0)
return "\r\n[Sql]:"+sql+"\r\n";
return $"\r\n[Sql]:{sql} \r\n[Pars]:{string.Join(" ",pars.Select(it=>$"\r\n[Name]:{it.ParameterName} [Value]:{it.Value} [Type]:{it.DbType} "))} \r\n";
}
public static string ToUnderLine(string str, bool isToUpper = false) public static string ToUnderLine(string str, bool isToUpper = false)
{ {
if (str == null || str.Contains("_")) if (str == null || str.Contains("_"))

Loading…
Cancel
Save