Skip to content

Instantly share code, notes, and snippets.

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.timeZoneInformation)",
"value": [
{
"alias": "Dateline Standard Time",
"displayName": "(UTC-12:00) International Date Line West"
},
{
"alias": "Samoa Standard Time",
"displayName": "(UTC+13:00) Samoa"
@regisdiogo
regisdiogo / Startup.cs
Last active June 13, 2022 11:17
ASP.NET Core - Json serializer settings Enum as string and ignore null values
public class Startup
{
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddJsonOptions(options =>
{
options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
});
}