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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user