2021-11-23 03:14:31 +08:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2022-04-26 18:29:18 +08:00
|
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
|
|
using SqlSugar;
|
2021-11-23 03:14:31 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.WebCore.BuilderExtend
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class JsonExtension
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void AddJsonFileService(this IMvcBuilder builder)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.AddNewtonsoftJson(options =>
|
|
|
|
|
|
{
|
|
|
|
|
|
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
|
|
|
|
|
|
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm";
|
2022-04-26 18:29:18 +08:00
|
|
|
|
|
|
|
|
|
|
//options.SerializerSettings.Converters.Add(new ValueToStringConverter());
|
2021-11-23 03:14:31 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|