Inspired by dotnet show (#386)

* Changed the order of the projects, Web first to infer as startup.

* Added encapsulated JSON serialization - and moved to System.Text.Json

* Refactored a few minor updates out

Co-authored-by: Eric Fleming <eric-fleming18@hotmail.com>
This commit is contained in:
David Pine
2020-06-11 14:47:05 -05:00
committed by GitHub
parent 70a919e145
commit 0af21d22f5
8 changed files with 105 additions and 13 deletions

View File

@@ -172,16 +172,15 @@ namespace Microsoft.eShopWeb.Web
{
ResponseWriter = async (context, report) =>
{
var result = JsonConvert.SerializeObject(
new
var result = new
{
status = report.Status.ToString(),
errors = report.Entries.Select(e => new
{
status = report.Status.ToString(),
errors = report.Entries.Select(e => new
{
key = e.Key,
value = Enum.GetName(typeof(HealthStatus), e.Value.Status)
})
});
key = e.Key,
value = Enum.GetName(typeof(HealthStatus), e.Value.Status)
})
}.ToJson();
context.Response.ContentType = MediaTypeNames.Application.Json;
await context.Response.WriteAsync(result);
}