示例#1
0
        private static List<Tuple<string, string>> GetErrors(KElmahDbContextBase dbContext)
        {
            List<Tuple<string, string>> result = new List<Tuple<string, string>>();

            using (var tran = dbContext.Database.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted))
            {
                var result_0 = dbContext.ELMAH_Error.Select(x => new { x.Type, x.Message }).Distinct().OrderBy(y => y.Type).ToList();

                result_0.ForEach(x => result.Add(new Tuple<string, string>(x.Type, x.Message)));

                return result;
            }
        }
示例#2
0
        private static List<string> GetErrorType(KElmahDbContextBase dbContext)
        {
            using (var tran = dbContext.Database.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted))
            {
                var result = dbContext.ELMAH_Error.Select(x => x.Type).Distinct().OrderBy(y => y).ToList();

                return result;
            }
        }
示例#3
0
 private static void DeleteError(KElmahDbContextBase dbContext, string errType, string errMessage)
 {
     var deleteData = dbContext.ELMAH_Error.Where(x => x.Type.Equals(errType, StringComparison.OrdinalIgnoreCase) && x.Message.Contains(errMessage)).ToList();
     dbContext.ELMAH_Error.RemoveRange(deleteData);
     dbContext.SaveChanges();
 }