Skip to content
Documentation

StructModelBinder<TModel> Class

Abstract base class for custom model binders that bind a struct of type TModel from a single value using TryParse(string).

public abstract class StructModelBinder<TModel> : HAKOM.Serialization.Http.Net.Api.ICustomModelBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder
where TModel : struct, System.ValueType, System.ValueType

TModel

The struct type to bind.

Inheritance System.Object 🡒 StructModelBinder<TModel>

Implements ICustomModelBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder

StructModelBinder<TModel>.BindModelAsync(ModelBindingContext) Method

Section titled “StructModelBinder<TModel>.BindModelAsync(ModelBindingContext) Method”
public System.Threading.Tasks.Task BindModelAsync(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext bindingContext);

bindingContext Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext

Implements BindModelAsync(ModelBindingContext)

System.Threading.Tasks.Task

StructModelBinder<TModel>.CanBind(Type, BindingSource) Method

Section titled “StructModelBinder<TModel>.CanBind(Type, BindingSource) Method”

Determines whether this binder can bind the specified modelType from the given bindingSource.

public virtual bool CanBind(System.Type modelType, Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? bindingSource);

modelType System.Type

The System.Type of the model to bind.

bindingSource Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource

The Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource indicating where the data originates, or null.

Implements CanBind(Type, BindingSource)

System.Boolean
true if this binder supports the specified model type and binding source; otherwise, false.

StructModelBinder<TModel>.TryParse(string) Method

Section titled “StructModelBinder<TModel>.TryParse(string) Method”

Attempts to parse the specified string value into an instance of TModel.

protected abstract HAKOM.ErrorHandling.Core.Net.Api.Result<TModel> TryParse(string value);

value System.String

The string value to parse.

HAKOM.ErrorHandling.Core.Net.Api.Result<TModel>
A Result<TValue> containing the parsed model on success, or an error on failure.

© 2026 Volue.Version v0.6.38017 November 2026