using System.Collections.Generic;
using Newtonsoft.Json.Linq;
public static void Main()
var testeA = new TesteA("varteste1", "varteste2");
var testeB = new TesteB();
var teste = JsonConvert.SerializeObject(testeA);
var jsonTeste = JObject.Parse(teste);
Type type = typeof(TesteA);
PropertyInfo[] propertyinfo=type.GetProperties();
List<string> nameList = new List<string>();
foreach(PropertyInfo info in propertyinfo)
foreach(var n in nameList)
testeB.GetType().GetProperty(n).SetValue(testeB, (string)jsonTeste[n]);
Console.WriteLine(testeB.FooA);
public TesteA(string fooA, string fooB){
public string FooA { get; set; }
public string FooB { get; set; }
public string FooA { get; set; }
public string FooB { get; set; }