WX
2022-02-20 4dce7940a4f2a6711bb261d8587a77ff259a2ebf
ZTICInterface.Web.Entry/Program.cs
@@ -1,21 +1,19 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using ZTICInterface.Application.Base;
using ZTICInterface.Application;
using ZTICInterface.Core;
var builder = WebApplication.CreateBuilder(args).Inject();
builder.Services.AddControllers()
    //.AddInjectWithUnifyResult<RESTfulResultProvider>()
    .AddNewtonsoftJson(options =>
builder.Services.AddControllers().AddNewtonsoftJson(options =>
    {
        options.SerializerSettings.ContractResolver =
            new CamelCasePropertyNamesContractResolver(); //序列化时key为驼峰样式
        options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Local;
        options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
        options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; //忽略循环引用
    })
    ;
    });
//builder.Services.AddInjectWithUnifyResult<MyRESTfulResultProvider>();
builder.Services.AddSqlsugarSetup();
builder.Services.AddSingleton(typeof(Repository<>));