Simplify.Web.Multipart is a package which provides multipart form view model and model binder for Simplify.Web web-framework.
public void Configuration(IApplicationBuilder app)
{
...
HttpModelHandler.RegisterModelBinder<HttpMultipartFormModelBinder>();
...
app.UseSimplifyWeb();
}
public void ConfigureServices(IServiceCollection services)
{
...
DIContainer.Current.RegisterHttpMultipartFormModelBinder();
...
}
public class MyController : ControllerAsync<MultipartViewModel>
{
public override async Task<ControllerResponse> Invoke()
{
await ReadModelAsync();
Model.Files
}
}
Multipart files will be deserialized to the controller model on first model access
public class MyController : Controller<MultipartViewModel>
{
public override ControllerResponse Invoke()
{
Model.Files
}
}