Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }