/// <summary> /// Erstellt ein neues ExceptionGroup-Objekt. /// </summary> /// <param name="id">Anfangswert der Eigenschaft Id.</param> /// <param name="typeFingerprintSha256Hash">Anfangswert der Eigenschaft TypeFingerprintSha256Hash.</param> /// <param name="exceptionType">Anfangswert der Eigenschaft ExceptionType.</param> /// <param name="exceptionFingerprint">Anfangswert der Eigenschaft ExceptionFingerprint.</param> /// <param name="exceptionLocation">Anfangswert der Eigenschaft ExceptionLocation.</param> public static ExceptionGroup CreateExceptionGroup(global::System.Int32 id, global::System.String typeFingerprintSha256Hash, global::System.String exceptionType, global::System.String exceptionFingerprint, global::System.String exceptionLocation) { ExceptionGroup exceptionGroup = new ExceptionGroup(); exceptionGroup.Id = id; exceptionGroup.TypeFingerprintSha256Hash = typeFingerprintSha256Hash; exceptionGroup.ExceptionType = exceptionType; exceptionGroup.ExceptionFingerprint = exceptionFingerprint; exceptionGroup.ExceptionLocation = exceptionLocation; return exceptionGroup; }
/// <summary> /// Veraltete Methode zum Hinzufügen eines neuen Objekts zum EntitySet 'ExceptionGroups'. Verwenden Sie stattdessen die Methode '.Add' der zugeordneten Eigenschaft 'ObjectSet<T>'. /// </summary> public void AddToExceptionGroups(ExceptionGroup exceptionGroup) { base.AddObject("ExceptionGroups", exceptionGroup); }
protected void PreProcessExceptions() { List<ExceptionImport> exceptions = (from s in message.Sessions from e in s.Exceptions select new ExceptionImport(e) { ClientSessionId = s.SessionID, IsFirstInSession = false }).ToList(); if (0 == exceptions.Count) return; // no exceptions reported, denormalisedExceptions remains null // mark first exception in session - note that above LINQ query does not mix up order of items long clientSession = -1; exceptions.ForEach(ex => { if (ex.ClientSessionId != clientSession) { ex.IsFirstInSession = true; clientSession = ex.ClientSessionId; } }); List<string> distinctMsgExceptionGroups = (from e in exceptions select e.FingerprintHash).Distinct().ToList(); List<string> knownExceptionGroups = ImportCache.GetExceptionGroupFingerprintHashes(repository); List<string> missing = distinctMsgExceptionGroups.Except(knownExceptionGroups).ToList(); if (missing.Count > 0) { List<ExceptionImport> groupsToAdd = (from e in exceptions join m in missing on e.FingerprintHash equals m select e).Distinct(new ExceptionImportGroupEqualityComparer()).ToList(); foreach (ExceptionImport imp in groupsToAdd) { ExceptionGroup modelGroup = new ExceptionGroup() { ExceptionFingerprint = imp.Fingerprint, ExceptionLocation = imp.Location, ExceptionType = imp.Type, TypeFingerprintSha256Hash = imp.FingerprintHash }; repository.Context.ExceptionGroups.AddObject(modelGroup); } repository.IgnoreDuplicateKeysOnSaveChanges<ExceptionGroup>(); ImportCache.InvalidateExceptionGroupsCaches(); } this.denormalisedExceptions = exceptions; }