Custom Model Building
Model binding allows controller actions to work directly with model types (passed in as method arguments), rather than HTTP requests. Mapping between incoming request data and application models is handled by model binders. Developers can extend the built-in model binding functionality by implementing custom model binders (though typically, you don't need to write your own provider).
The following sample uses the ModelBinder
attribute on the Author
model:
The following AuthorEntityBinder
class binds an Author
parameter:
The ModelBinder
attribute can be used to apply the AuthorEntityBinder
to parameters that don't use default conventions:
Last updated