using System.Collections.Generic;
using Newtonsoft.Json.Serialization;
public static void Main()
ITraceWriter traceWriter = new MemoryTraceWriter();
var json = @"{'PolicyName':'policyName1test','Fqdns':['FQDN1'],'RequiresCredentials':false,'ToRetrievalModel':{'PolicyName':'policyName1test','mFqdns':['FQDN2', 'FQDN3'],'RequiresCredentials':false}}";
var model = JsonConvert.DeserializeObject<ProxyTemplateCreateModel>(json, new JsonSerializerSettings { TraceWriter = traceWriter});
Console.WriteLine(model);
public class ProxyTemplateCreateModel
public string PolicyName { get; set; }
public IList<string> Fqdns { get; set; }
public bool RequiresCredentials { get; set; }
public ProxyTemplateModel ToRetrievalModel => new ProxyTemplateModel
mFqdns = Fqdns?.Select(x => x).ToList(),
RequiresCredentials = RequiresCredentials,
public override string ToString() => String.Join("; ", Fqdns);
public class ProxyTemplateModel
public string PolicyName { get; set; }
public IList<string> mFqdns { get; set; }
public bool RequiresCredentials { get; set; }