public static void Main()
var tasksSerialized = JsonConvert.SerializeObject(new TaskEntity
Street1 = LocationFaker.Street(),
Number = LocationFaker.StreetNumber().ToString(),
City = LocationFaker.City(),
ZipCode = LocationFaker.ZipCode(),
Country = LocationFaker.Country()
Console.WriteLine(tasksSerialized);
var taskEntities = JsonConvert.DeserializeObject<TaskEntity>(tasksSerialized);
Console.WriteLine("Street1: " + taskEntities.Street1);
public Address Addresses { get; set; }
[JsonProperty(PropertyName = "Addresses.Street1")]
public string Street1 { get; set; }
public string Street2 { get; set; }
public string Number { get; set; }
public string Box { get; set; }
public string ZipCode { get; set; }
public string City { get; set; }
public string Country { get; set; }
public string Street1 { get; set; }
public string Street2 { get; set; }
public string Number { get; set; }
public string Box { get; set; }
public string ZipCode { get; set; }
public string City { get; set; }
public string Country { get; set; }
public override string ToString()
return string.Format("{0} {1}{2}, {3} {4}, {5}",
(string.IsNullOrEmpty(Box) ? "" : " " + Box),