/// <summary> /// Reset the last execution configuration except for error handlers, and factory configuration options. /// The <see cref="FluentApiFactory"/>'s internal dictionary of previously created types, such as interfaces, /// proxies, and fluent API types, are also discarded. /// </summary> /// <returns></returns> public FluentApiFactoryConfig Reset() { CheckDisposed(); FluentApiFactory.Reset(); _result = null; _executed = false; _assemblyTypes = null; return(this); }
/// <summary> /// Dispose all resources used by the current <see cref="FluentApiFactoryConfig"/>, /// including error handlers, and optionally the last execution result. /// </summary> /// <param name="all">true to also discard the last execution result; otherwise, false.</param> /// <returns></returns> public FluentApiFactoryConfig ReleaseResources(bool all = false) { CheckDisposed(); if (_onErrorHandler != null) { FluentApiFactory.Error -= _onErrorHandler; _onErrorHandler = null; } if (_onDeleteHandler != null) { FluentApiFactory.DeleteFileError -= _onDeleteHandler; _onDeleteHandler = null; } if (all) { Reset(); } else { FluentApiFactory.Reset(); } return(this); }