Struct BinderContext
binder context supplied to custom request binders.
Implements
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public readonly struct BinderContext : IServiceResolverBase
Constructors
BinderContext(HttpContext, List<ValidationFailure>, JsonSerializerContext, Boolean)
constructor of the binder context
Declaration
public BinderContext(HttpContext httpContext, List<ValidationFailure> validationFailures, JsonSerializerContext jsonSerializerContext, bool dontAutoBindForms)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.HttpContext | httpContext | the http context of the current request |
System.Collections.Generic.List<FluentValidation.Results.ValidationFailure> | validationFailures | the validation failure collection of the endpoint |
System.Text.Json.Serialization.JsonSerializerContext | jsonSerializerContext | json serializer context of the endpoint if applicable |
System.Boolean | dontAutoBindForms | whether or not to enable auto binding of form data |
Properties
DontAutoBindForms
set 'true' to disable auto binding of form data which enables uploading and reading of large files without buffering to memory/disk. you can access the multipart sections for reading via the FormFileSectionsAsync() method.
Declaration
public bool DontAutoBindForms { readonly get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HttpContext
the http context of the current request
Declaration
public HttpContext HttpContext { readonly get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Http.HttpContext |
JsonSerializerContext
if the current endpoint is configured with a json serializer context, it will be provided to the custom request binder with this property.
Declaration
public JsonSerializerContext JsonSerializerContext { readonly get; set; }
Property Value
Type | Description |
---|---|
System.Text.Json.Serialization.JsonSerializerContext |
SerializerOptions
the configured json serializer options of the app, which was specified at app startup.
Declaration
public readonly JsonSerializerOptions SerializerOptions { get; }
Property Value
Type | Description |
---|---|
System.Text.Json.JsonSerializerOptions |
ValidationFailures
a list of validation failures for the endpoint. you can add your own validation failures for properties of the request dto using this property.
Declaration
public List<ValidationFailure> ValidationFailures { readonly get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FluentValidation.Results.ValidationFailure> |
Methods
CreateScope()
binder context supplied to custom request binders.
Declaration
public readonly IServiceScope CreateScope()
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IServiceScope |
Resolve(Type)
binder context supplied to custom request binders.
Declaration
public readonly object Resolve(Type typeOfService)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeOfService |
Returns
Type | Description |
---|---|
System.Object |
Resolve<TService>()
binder context supplied to custom request binders.
Declaration
public readonly TService Resolve<TService>()
where TService : class
Returns
Type | Description |
---|---|
TService |
Type Parameters
Name | Description |
---|---|
TService |
TryResolve(Type)
binder context supplied to custom request binders.
Declaration
public readonly object TryResolve(Type typeOfService)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeOfService |
Returns
Type | Description |
---|---|
System.Object |
TryResolve<TService>()
binder context supplied to custom request binders.
Declaration
public readonly TService TryResolve<TService>()
where TService : class
Returns
Type | Description |
---|---|
TService |
Type Parameters
Name | Description |
---|---|
TService |