/// <summary>
 /// deletes records.
 /// </summary>
 /// <returns></returns>
 public static int DeleteAllErrorObjects()
 {
     var dc = new ErrorContext();
     var obj = dc.ErrorExceptions.OrderByDescending(x => x.Created);
     int count = 0;
     foreach (var error in obj)
     {
         dc.ErrorExceptions.Remove(error);
         count++;
         if (count == 200)
             break;
     }
     var result = dc.SaveChanges();
     return count;
 }
        public static bool DeleteErrorObject(int id)
        {
            var dc = new ErrorContext();
            var obj = dc.ErrorExceptions.FirstOrDefault(x => x.ExceptionId.Equals(id));
            if (obj == null) return false;
            dc.ErrorExceptions.Remove(obj);
            var result = dc.SaveChanges();
            return result > 0;

        }