I\'ve created an ASP.Net WEB API Project that will be used by a mobile application. I need the response json to omit null properties instead of return them as property
property
For ASP.NET Core 3.0, the ConfigureServices() method in Startup.cs code should contain:
ConfigureServices()
Startup.cs
services.AddControllers() .AddJsonOptions(options => { options.JsonSerializerOptions.IgnoreNullValues = true; });