using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using LanShengService; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers().AddNewtonsoftJson(options => { options.SerializerSettings.ContractResolver = new DefaultContractResolver(); options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; }).AddDapr(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.InitLanShengService(builder.Configuration); var app = builder.Build(); app.UseSwagger(); app.UseSwaggerUI(); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseStaticFiles(); app.MapControllers(); app.CreateLanShengService(); app.Run();