| | |
| | | |
| | | var builder = WebApplication.CreateBuilder(args).Inject(); |
| | | |
| | | builder.Services.AddControllers().AddNewtonsoftJson(options => |
| | | builder.Services.AddControllers() |
| | | .AddUnifyResult<MyRESTfulResultProvider>() |
| | | .AddNewtonsoftJson(options => |
| | | { |
| | | options.SerializerSettings.ContractResolver = |
| | | new CamelCasePropertyNamesContractResolver(); //序列化时key为驼峰样式 |
| | |
| | | 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<>)); |