/// <inheritdoc cref="IEndpointResult.ExecuteResultAsync"/>
 public ValueTask ExecuteResultAsync(HttpContext context, EndpointOptions options)
 {
     return(ValueTask.CompletedTask);
 }
示例#2
0
 /// <inheritdoc cref="IEndpointResult.ExecuteResultAsync"/>
 public ValueTask ExecuteResultAsync(HttpContext context, EndpointOptions options)
 {
     context.Response.StatusCode = StatusCode;
     return(ValueTask.CompletedTask);
 }
示例#3
0
 public override ValueTask <ParameterBindingResult> Factory(HttpContext httpContext, EndpointOptions options, IBindingErrorCollection bindingErrorCollection)
 {
     return(options.JsonSerializer.DeserializeFromRequest(httpContext.Request, descriptor.ParameterType, bindingErrorCollection, httpContext.RequestAborted));
 }
示例#4
0
 /// <summary>
 /// Constructs new EndpointOptionBuilders
 /// </summary>
 public EndpointOptionBuilders()
 {
     option = new EndpointOptions();
 }
示例#5
0
 /// <summary>
 /// Factory for building parameter from HttpContext
 /// </summary>
 public abstract ValueTask <ParameterBindingResult> Factory(HttpContext httpContext, EndpointOptions options, IBindingErrorCollection bindingErrorCollection);
        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);
        }
示例#7
0
 internal EasyEndpointBuilder(IServiceCollection serviceCollection, EasyEndpointBuilderOptions builderOptions, EndpointOptions endpointOptions)
 {
     this.serviceCollection = serviceCollection;
     this.endpointOptions   = endpointOptions;
     this.builderOptions    = builderOptions;
 }
示例#8
0
 /// <inheritdoc />
 public async ValueTask ExecuteResultAsync(HttpContext context, EndpointOptions options)
 {
     context.Response.StatusCode = StatusCode;
     await options.JsonSerializer.SerializeToResponse(context.Response, Result, context.RequestAborted);
 }