mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 14:04:44 +08:00
Add : UtilMethods.GetNativeSql
This commit is contained in:
parent
d059743691
commit
f1ad5ac2bb
@ -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…
Reference in New Issue
Block a user