json Bugs from Newtonsoft.Json to System.Text.Json

This commit is contained in:
2022-07-27 12:30:27 -07:00
parent b155863645
commit c832b63f2f
5 changed files with 36 additions and 22 deletions

View File

@ -11,6 +11,7 @@ using OI.Metrology.Shared.Repositories;
using OI.Metrology.Shared.Services;
using OI.Metrology.Viewer.Models;
using System.Collections.Generic;
using System.Text.Json;
// using System.Data.Common;
@ -39,7 +40,7 @@ public class ToolTypesController : Controller
{
Results = _Repo.GetToolTypes().Select(tt => new { tt.ToolTypeName, tt.ID })
};
return Json(r);
return Json(r, new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
}
// Gets the metadata for a tooltype, accepts a parameter which sorts the results
@ -63,7 +64,7 @@ public class ToolTypesController : Controller
Metadata = md
}
};
return Json(r);
return Json(r, new JsonSerializerOptions { PropertyNamingPolicy = null, WriteIndented = true });
}
// Gets headers, request/response format is to allow paging with igniteUI