File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11using System;
2+ using System.Threading.Tasks;
23using HttpMultipartParser;
34using Simplify.Web.Model.Binding;
45
@@ -15,7 +16,7 @@ public class HttpMultipartFormModelBinder : IModelBinder
1516 /// </summary>
1617 /// <typeparam name="T">Model type</typeparam>
1718 /// <param name="args">The <see cref="ModelBinderEventArgs{T}" /> instance containing the event data.</param>
18- public void Bind <T>(ModelBinderEventArgs<T> args)
19+ public async Task BindAsync <T>(ModelBinderEventArgs<T> args)
1920 {
2021 if (!args.Context.Request.ContentType.Contains("multipart/form-data"))
2122 return;
@@ -25,7 +26,7 @@ public void Bind<T>(ModelBinderEventArgs<T> args)
2526 if (typeof(T) != multipartModelType)
2627 throw new ModelBindingException("For HTTP multipart form data model type should be: " + multipartModelType.Name);
2728
28- var parser = new MultipartFormDataParser(args.Context.Request.Body);
29+ var parser = await MultipartFormDataParser.ParseAsync (args.Context.Request.Body);
2930 var obj = Activator.CreateInstance<T>();
3031
3132 var model = (MultipartViewModel)(object)obj;
Original file line number Diff line number Diff line change 66 <Product>Simplify</Product>
77 <Description>Simplify.Web multipart form model binder</Description>
88 <Copyright>Licensed under LGPL</Copyright>
9- <Version>1.1 </Version>
9+ <Version>1.2 </Version>
1010 <PackageProjectUrl>https://github.com/SimplifyNet/Simplify.Web.Multipart</PackageProjectUrl>
1111 <PackageIconUrl>https://raw.githubusercontent.com/SimplifyNet/Images/master/LogoWeb32x32.png</PackageIconUrl>
1212 <RepositoryUrl>https://github.com/SimplifyNet/Simplify.Web.Multipart</RepositoryUrl>
1313 <RepositoryType>GIT</RepositoryType>
1414 <PackageTags>Simplify.Web multipart</PackageTags>
1515 <PackageReleaseNotes>
16- New
17- * `IDIRegistrator` `HttpMultipartFormModelBinder` registration extension method (#3)
1816 Updates
19- * Upgrade to Simplify.Web 3 (PR #2)
17+ * Upgrade to Simplify.Web 4 (#5)
18+ * Upgrade to HttpMultipartParser 3.1 (PR #7)
2019 </PackageReleaseNotes>
2120 <OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
2221 <DocumentationFile>bin\Any CPU\$(Configuration)\$(TargetFramework)\Simplify.Web.Multipart.xml</DocumentationFile>
2322 </PropertyGroup>
2423 <ItemGroup>
25- <PackageReference Include="Simplify.Web" Version="3 .0.0" />
26- <PackageReference Include="HttpMultipartParser" Version="2.2.4 " />
24+ <PackageReference Include="Simplify.Web" Version="4 .0.0" />
25+ <PackageReference Include="HttpMultipartParser" Version="3.1.0 " />
2726 </ItemGroup>
2827</Project>
You can’t perform that action at this time.
0 commit comments