-
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.
Showing
13 changed files
with
76 additions
and
112 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
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
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,28 +1,41 @@ | ||
using Microsoft.AspNetCore.Hosting; | ||
using Asp.Versioning; | ||
using Byndyusoft.AspNetCore.Mvc.Formatters.MessagePack.Swagger; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
namespace Byndyusoft.AspNetCore.Mvc.Formatters.MessagePack | ||
{ | ||
/// <summary> | ||
/// Program | ||
/// </summary> | ||
public static class Program | ||
{ | ||
/// <summary> | ||
/// Main | ||
/// </summary> | ||
public static void Main(string[] args) | ||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
var services = builder.Services; | ||
services | ||
.AddApiVersioning( | ||
options => | ||
{ | ||
CreateHostBuilder(args).Build().Run(); | ||
options.DefaultApiVersion = ApiVersion.Default; | ||
options.AssumeDefaultVersionWhenUnspecified = true; | ||
options.ReportApiVersions = true; | ||
} | ||
|
||
private static IHostBuilder CreateHostBuilder(string[] args) | ||
) | ||
.AddApiExplorer( | ||
options => | ||
{ | ||
return Host.CreateDefaultBuilder(args) | ||
.ConfigureWebHostDefaults(webBuilder => | ||
{ | ||
webBuilder.UseStartup<Startup>(); | ||
}); | ||
options.GroupNameFormat = "'v'VVV"; | ||
options.SubstituteApiVersionInUrl = true; | ||
} | ||
} | ||
} | ||
); | ||
|
||
services.AddSwagger(); | ||
|
||
services | ||
.AddMvcCore() | ||
.AddMessagePackFormatters() | ||
.AddFormatterMappings(); | ||
services.AddControllers(); | ||
|
||
var app = builder.Build(); | ||
if (app.Environment.IsProduction() == false) | ||
app.UseSwaggerWithApiVersionDescriptionProvider(); | ||
|
||
app.MapControllers(); | ||
app.UseRouting(); | ||
app.Run(); |
This file was deleted.
Oops, something went wrong.
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
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
15 changes: 7 additions & 8 deletions
15
tests/Byndyusoft.AspNetCore.Mvc.Formatters.MessagePack.Tests.csproj
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