/// <summary> /// 新增 /// </summary> /// <param name="c">错误类型</param> /// <param name="message">消息</param> /// <param name="stackTrace">堆栈信息</param> /// <returns></returns> public static ExceptionLog create(HttpStatusCode c, string message, string stackTrace) { Db_ExceptionLog log = new Db_ExceptionLog() { code = c.GetHashCode().ToString(), codeString = c.ToString(), createdOn = DateTime.Now, message = message, logType = (byte)BaseLogType.异常日志.GetHashCode(), stackTrace = stackTrace }; using (var db = new DefaultContainer()) { db.Db_BaseLogSet.Add(log); db.SaveChanges(); return(new ExceptionLog(log)); } }
private void setValue(Db_ExceptionLog row) { this.code = row.code; this.codeString = row.codeString; this.stackTrace = row.stackTrace; }
public ExceptionLog(Db_ExceptionLog row) : base(row) { setValue(row); }