private void SaveLog(string executionPath, object param, Exception exception, string extraData = "") { try { var db = new AdvancedWfContext(); db.ErrorLogs.Add(new ErrorLog { Method = executionPath, Exception = GetError(exception), Param = JsonConvert.SerializeObject(param, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }), CreationDate = DateTime.Now, ModificationDate = DateTime.Now, AddtionalData = extraData ?? "Empty" }); db.SaveChanges(); } catch (Exception) { try { var db = new AdvancedWfContext(); db.ErrorLogs.Add(new ErrorLog { Method = executionPath, Param = "EMPTY", Exception = GetError(exception), CreationDate = DateTime.Now, ModificationDate = DateTime.Now, AddtionalData = extraData ?? "Empty" }); db.SaveChanges(); } catch { //Ignore } } }