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