https://github.com/simplifynet/simplify.web.multipart
Simplify.Web multipart form model binder
https://github.com/simplifynet/simplify.web.multipart
dot-net dot-net-core multipart multipart-data simplify simplify-web
Last synced: about 1 month ago
JSON representation
Simplify.Web multipart form model binder
- Host: GitHub
- URL: https://github.com/simplifynet/simplify.web.multipart
- Owner: SimplifyNet
- License: lgpl-3.0
- Created: 2019-09-15T04:52:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-15T06:20:29.000Z (5 months ago)
- Last Synced: 2025-04-02T17:11:19.959Z (about 2 months ago)
- Topics: dot-net, dot-net-core, multipart, multipart-data, simplify, simplify-web
- Language: C#
- Size: 3.98 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Simplify.Web.Multipart
[](https://www.nuget.org/packages/Simplify.Web.Multipart/)
[](https://www.nuget.org/packages/Simplify.Web.Multipart/)
[](https://github.com/SimplifyNet/Simplify.Web.Multipart/actions/workflows/build.yml)[](https://libraries.io/nuget/Simplify.Web.Multipart)
[](https://www.codefactor.io/repository/github/simplifynet/simplify.web.Multipart)

[](http://makeapullrequest.com)[Simplify.Web.Multipart](https://www.nuget.org/packages/Simplify.Web.Multipart/) is a package which provides multipart form view model and model binder for [Simplify.Web](https://github.com/SimplifyNet/Simplify.Web) web-framework.
## Quick start
### Registering binder
```csharp
public void Configuration(IApplicationBuilder app)
{
...
HttpModelHandler.RegisterModelBinder();
...
app.UseSimplifyWeb();
}public void ConfigureServices(IServiceCollection services)
{
...
DIContainer.Current.RegisterHttpMultipartFormModelBinder();
...
}
```### Getting files from client
#### Asynchronous
```csharp
public class MyController : ControllerAsync
{
public override async Task Invoke()
{
await ReadModelAsync();Model.Files
}
}
```#### Synchronous
Multipart files will be deserialized to the controller model on first model access
```csharp
public class MyController : Controller
{
public override ControllerResponse Invoke()
{
Model.Files
}
}
```