Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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 })));
             }
         }
     }
 }
Esempio n. 3
0
 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);
     }
 }