private static string GetMessage(string message, object pars) { var parsStr = string.Empty;; if (pars != null) { parsStr = JsonConverter.Serialize(pars); } var reval = GetLineMessage("错误信息", message) + GetLineMessage("函数参数", parsStr); return(reval); }
private void ExecLogEvent(string sql, SQLiteParameter[] pars, bool isStarting = true) { if (IsEnableLogEvent) { Action <string, string> action = isStarting ? LogEventStarting : LogEventCompleted; if (action != null) { if (pars == null || pars.Length == 0) { action(sql, null); } else { action(sql, JsonConverter.Serialize(pars.Select(it => new { key = it.ParameterName, value = it.Value }))); } } } }
private static string GetMessage(string message, string sql, object pars) { if (pars == null) { return(GetMessage(message, sql)); } else { var reval = GetLineMessage("错误信息 ", message) + GetLineMessage("ORM生成的Sql", sql) + GetLineMessage("函数参数 ", JsonConverter.Serialize(pars)); return(reval); } }