Net Core 3.1 API
最近在玩玩Net Core 3.1 API的時候,return開頭變小寫了,在services加入該段,就可以回到原本大小寫
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
//return Data 維持大小寫
services.AddControllers()
.AddJsonOptions(options => options.JsonSerializerOptions.PropertyNamingPolicy = null);
}
元哥的筆記