/// <summary> /// Add services of enabled attributes. /// </summary> /// <param name="services"> /// The <see cref="IServiceCollection"/> containing API service registrations. /// </param> /// <param name="apiType"> /// The type of a class on which code-based conventions are used. /// </param> /// <returns>Current <see cref="IServiceCollection"/></returns> public static IServiceCollection AddAttributeServices(this IServiceCollection services, Type apiType) { Ensure.NotNull(apiType, "apiType"); ApiConfiguratorAttributes.AddApiServices(apiType, services); return(services); }
/// <summary> /// Performs application-defined tasks associated with /// freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (this.IsDisposed) { return; } if (this.apiContext != null) { ApiConfiguratorAttributes.ApplyDisposal( this.GetType(), this, this.apiContext); } this.Dispose(true); GC.SuppressFinalize(this); }