public static ErrorEntity FetchError(DataAccessAdapterBase adapter, PrefetchPath2 prefetchPath, long ErrorId) { ErrorEntity _ErrorEntity = new ErrorEntity(ErrorId); adapter.FetchEntity(_ErrorEntity, prefetchPath); return(_ErrorEntity); }
/// <summary> setups the sync logic for member _parentError</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncParentError(IEntityCore relatedEntity) { if (_parentError != relatedEntity) { DesetupSyncParentError(true, true); _parentError = (ErrorEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_parentError, new PropertyChangedEventHandler(OnParentErrorPropertyChanged), "ParentError", NinjaSoftware.EnioNg.CoolJ.RelationClasses.StaticErrorRelations.ErrorEntityUsingErrorIdParentErrorIdStatic, true, new string[] { }); } }
/// <summary> /// Automatically populates fields with exception information /// </summary> /// <param name="e"></param> public ErrorEntity(Exception e) : this() { this.Message = e.Message; this.StackTrace = e.StackTrace; this.ErrorDateTime = DateTime.Now; if (null != e.InnerException) { ErrorEntity errorEntity = new ErrorEntity(e.InnerException); this.ChildErrorCollection.Add(errorEntity); } }
protected ErrorEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _childErrorCollection = (EntityCollection <ErrorEntity>)info.GetValue("_childErrorCollection", typeof(EntityCollection <ErrorEntity>)); _parentError = (ErrorEntity)info.GetValue("_parentError", typeof(ErrorEntity)); if (_parentError != null) { _parentError.AfterSave += new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
public static void LogException(DataAccessAdapterBase adapter, Exception exception) { ErrorEntity error = new ErrorEntity(exception); adapter.SaveEntity(error, false, false); }
/// <summary> Removes the sync logic for member _parentError</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncParentError(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_parentError, new PropertyChangedEventHandler(OnParentErrorPropertyChanged), "ParentError", NinjaSoftware.EnioNg.CoolJ.RelationClasses.StaticErrorRelations.ErrorEntityUsingErrorIdParentErrorIdStatic, true, signalRelatedEntity, "ChildErrorCollection", resetFKFields, new int[] { (int)ErrorFieldIndex.ParentErrorId }); _parentError = null; }