private static EasyEndpointBuilder AddEmptyEasyEndpoints(this IServiceCollection services, EndpointOptions options)
        {
            services.AddTransient(ManifestHelper.BuidManifest);
            services.AddSingleton(options);
            services.AddTransient <IEasyEndpointCompositeMetadataDetailsProvider, EasyEndpointCompositeMetadataDetailsProvider>();
            services.AddTransient <IApiDescriptionGroupCollectionProvider, EasyEndpointApiDescriptionGroupCollectionProvider>();
            var builderOptions = new EasyEndpointBuilderOptions();

            services.AddSingleton(builderOptions);

            services.AddTransient <IMalformedRequestExceptionHandler, DefaultIMalformedRequestExceptionHandler>();
            var builder = new EasyEndpointBuilder(services, builderOptions, options);

            AddDefaultParsers(builder);
            return(builder);
        }
示例#2
0
 internal EasyEndpointBuilder(IServiceCollection serviceCollection, EasyEndpointBuilderOptions builderOptions, EndpointOptions endpointOptions)
 {
     this.serviceCollection = serviceCollection;
     this.endpointOptions   = endpointOptions;
     this.builderOptions    = builderOptions;
 }