http://stackoverflow.com/questions/43714050/multiple-jsonproperty-name-assigned-to-single-property

CSharp · Console

/Program.cs

using System;
using Newtonsoft.Json;
					
public class Program
{
	public static void Main()
	{
		string json1 = @"{
            'field1': '123456789012345',
            'specifications': {
                'name1': 'HFE1'
            }
        }";

		DeserializeAndDump(json1);

        string json2 = @"{
            'field1': '1234567890abcde',
            'specifications': {
                'name2': 'HFE2'
            }
        }";

		DeserializeAndDump(json2);
	}
	
	private static void DeserializeAndDump(string json)
	{
		var obj = JsonConvert.DeserializeObject<ClassToDeserialize>(json);
		Console.WriteLine("Vin: " + obj.Vin);
		Console.WriteLine("Specifications: " + obj.Specifications.CodeModel);
		Console.WriteLine();
	}
}


public class Specifications
{
    [JsonProperty("name1")]
    public string CodeModel { get; set; }

    [JsonProperty("name2")]
	private string CodeModel2 { set { CodeModel = value; } }
}

public class ClassToDeserialize
{
    [JsonProperty("field1")]
    public string Vin { get; set; }

    [JsonProperty("specifications")]
    public Specifications Specifications { get; set; }        
}
;