From 6fbc82540689bc81ca180ce34dba0c68ced4aa41 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 2 Apr 2020 17:30:36 +0800 Subject: [PATCH] update Former-commit-id: b77128a1da66774a8cfe677fed6b46cfc48a9d40 --- projects/IoTNode/IoTNode.csproj | 2 +- projects/IoTNode/Program.cs | 1 + projects/UserCenter/Controllers/HomeController.cs | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) 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()); } }