diff --git a/projects/IoTNode/IoTNode.csproj b/projects/IoTNode/IoTNode.csproj index 1badc058..3e12a44f 100644 --- a/projects/IoTNode/IoTNode.csproj +++ b/projects/IoTNode/IoTNode.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 true - 1.0.0-beta.330 + 1.0.0-beta.402 diff --git a/projects/IoTNode/Program.cs b/projects/IoTNode/Program.cs index 62eb69aa..450ecef4 100644 --- a/projects/IoTNode/Program.cs +++ b/projects/IoTNode/Program.cs @@ -18,6 +18,7 @@ namespace IoTNode .AddJsonFile("appsettings.json", optional: true) .Build(); WebHost.CreateDefaultBuilder(args) + .UseConfiguration(config) .ConfigureLogging((c, o) => { Log.Logger = new LoggerConfiguration() diff --git a/projects/UserCenter/Controllers/HomeController.cs b/projects/UserCenter/Controllers/HomeController.cs index dd77877a..d6059c2c 100644 --- a/projects/UserCenter/Controllers/HomeController.cs +++ b/projects/UserCenter/Controllers/HomeController.cs @@ -7,6 +7,7 @@ using Infrastructure.Security; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Localization; +using Newtonsoft.Json; using System.Linq; namespace UserCenter.Controllers @@ -30,8 +31,11 @@ namespace UserCenter.Controllers public IActionResult Index() { - //var modelMetadata = this.GetModelMetadata(); - //var json = modelMetadata.ToJson(); + var modelMetadata = this.GetModelMetadata(); + var json = JsonConvert.SerializeObject(modelMetadata, new JsonSerializerSettings + { + ReferenceLoopHandling = ReferenceLoopHandling.Ignore, + }); return View(this._siteRepo.ReadOnlyTable().ToList()); } }