C# JSON converter that removes duplicate items from collections during serialization.
// Source: https://github.com/sendgrid/sendgrid-csharp | License: MIT | Copyright 2024, Twilio SendGrid, Inc. <help@twilio.com>
// Provided via justclaw.it.com; keep this notice with the code.
// <copyright file="JsonConverters.cs" company="Twilio SendGrid">
// Copyright (c) Twilio SendGrid. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
#if NET40
using SendGrid.Helpers.Net40;
#else
using System.Reflection;
#endif
namespace SendGrid.Helpers.Mail
{
/// <summary>
/// Removes duplicates when writing the JSON representation of the object.
/// </summary>
public class RemoveDuplicatesConverter<T> :
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key