private static JsonSerializerSettings SerializerSettings(ISlackTypeResolver slackTypeResolver) { var namingStrategy = new SnakeCaseNamingStrategy(); return(new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, ContractResolver = new DefaultContractResolver { NamingStrategy = namingStrategy, }, Converters = { new EnumNameConverter(namingStrategy), new SlackTypeConverter(slackTypeResolver) } }); }
private static JsonSerializerSettings SerializerSettings(ISlackTypeResolver slackTypeResolver) { var namingStrategy = new SnakeCaseNamingStrategy(); return(new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, DateFormatString = "yyyy-MM-dd", ContractResolver = new SlackNetContractResolver { NamingStrategy = namingStrategy, }, Converters = { new EnumNameConverter(namingStrategy), new TimeSpanConverter(), new SlackTypeConverter(slackTypeResolver) } }); }
private static JsonSerializerSettings SerializerSettings(ISlackTypeResolver slackTypeResolver) { var namingStrategy = new SnakeCaseNamingStrategy(); return(new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, ContractResolver = new SlackNetContractResolver { NamingStrategy = namingStrategy, }, Converters = { new EnumNameConverter(namingStrategy), new SlackTypeConverter(slackTypeResolver), new IsoDateTimeConverter { DateTimeFormat = "YYYY-MM-DD" } } }); }
public SlackTypeConverter(ISlackTypeResolver slackTypeResolver) { _slackTypeResolver = slackTypeResolver; }
public static SlackJsonSettings JsonSettings(ISlackTypeResolver slackTypeResolver = null) => new SlackJsonSettings(SerializerSettings(slackTypeResolver ?? SlackTypeResolver()));
public static SlackJsonSettings JsonSettings(ISlackTypeResolver slackTypeResolver) => new SlackJsonSettings(SerializerSettings(slackTypeResolver));