-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
125 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"cSpell.words": [ | ||
"cref", | ||
"registrator" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
using System.Collections.Generic; | ||
using HttpMultipartParser; | ||
|
||
namespace Simplify.Web.Multipart.Model | ||
namespace Simplify.Web.Multipart.Model; | ||
|
||
/// <summary> | ||
/// HTTP multipart form data model | ||
/// </summary> | ||
public class MultipartViewModel | ||
{ | ||
/// <summary> | ||
/// HTTP multipart form data model | ||
/// HTTP multipart form data files | ||
/// </summary> | ||
public class MultipartViewModel | ||
{ | ||
/// <summary> | ||
/// HTTP multipart form data files | ||
/// </summary> | ||
/// <value> | ||
/// The files. | ||
/// </value> | ||
public IReadOnlyList<FilePart> Files { get; set; } | ||
/// <value> | ||
/// The files. | ||
/// </value> | ||
public IReadOnlyList<FilePart> Files { get; set; } | ||
|
||
/// <summary> | ||
/// HTTP multipart form data parameters | ||
/// </summary> | ||
/// <value> | ||
/// The parameters. | ||
/// </value> | ||
public IReadOnlyList<ParameterPart> Parameters { get; set; } | ||
} | ||
/// <summary> | ||
/// HTTP multipart form data parameters | ||
/// </summary> | ||
/// <value> | ||
/// The parameters. | ||
/// </value> | ||
public IReadOnlyList<ParameterPart> Parameters { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
src/Simplify.Web.Multipart/SimplifyDIRegistratorExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
using Simplify.DI; | ||
using Simplify.Web.Multipart.Model.Binding; | ||
|
||
namespace Simplify.Web.Multipart | ||
namespace Simplify.Web.Multipart; | ||
|
||
/// <summary> | ||
/// Provides Simplify.Web.Json default registration | ||
/// </summary> | ||
public static class SimplifyDIRegistratorExtensions | ||
{ | ||
/// <summary> | ||
/// Provides Simplify.Web.Json default registration | ||
/// Registers Simplify.Web.Json JsonModelBinder. | ||
/// </summary> | ||
public static class SimplifyDIRegistratorExtensions | ||
{ | ||
/// <summary> | ||
/// Registers Simplify.Web.Json JsonModelBinder. | ||
/// </summary> | ||
/// <param name="registrator">The registrator.</param> | ||
public static IDIRegistrator RegisterHttpMultipartFormModelBinder(this IDIRegistrator registrator) => | ||
registrator.Register<HttpMultipartFormModelBinder>(LifetimeType.Singleton); | ||
} | ||
/// <param name="registrator">The registrator.</param> | ||
public static IDIRegistrator RegisterHttpMultipartFormModelBinder(this IDIRegistrator registrator) => | ||
registrator.Register<HttpMultipartFormModelBinder>(LifetimeType.Singleton); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
using Simplify.Web; | ||
using Simplify.Web.Attributes; | ||
|
||
namespace TestServer.Controllers | ||
namespace TestServer.Controllers; | ||
|
||
[Get("status")] | ||
public class StatusController : Controller | ||
{ | ||
[Get("status")] | ||
public class StatusController : Controller | ||
{ | ||
public override ControllerResponse Invoke() | ||
{ | ||
return Content("Service is running!"); | ||
} | ||
} | ||
public override ControllerResponse Invoke() => Content("Service is running!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
|
||
namespace TestServer | ||
namespace TestServer; | ||
|
||
public class Program | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) => CreateWebHostBuilder(args).Build().Run(); | ||
public static void Main(string[] args) => CreateWebHostBuilder(args).Build().Run(); | ||
|
||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | ||
WebHost.CreateDefaultBuilder(args) | ||
.UseStartup<Startup>(); | ||
} | ||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | ||
WebHost.CreateDefaultBuilder(args) | ||
.UseStartup<Startup>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
using Simplify.DI; | ||
using Simplify.Web.Multipart; | ||
|
||
namespace TestServer.Setup | ||
namespace TestServer.Setup; | ||
|
||
public static class IocRegistrations | ||
{ | ||
public static class IocRegistrations | ||
{ | ||
public static void Register() | ||
{ | ||
DIContainer.Current.RegisterHttpMultipartFormModelBinder(); | ||
} | ||
} | ||
public static void Register() => DIContainer.Current.RegisterHttpMultipartFormModelBinder(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters