querybuilder
querybuilder copied to clipboard
Mapping query result to Property of certain type
Hello,
I am trying to see if it is possible to map results to an Property which is an object.
public class Location
{
public Guid LocationId { get; set; }
public Address Address { get; set; }
}
public class Address
{
public string Address1 { get; set; }
public string Address2 { get; set; }
public string Suite { get; set; }
public int City { get; set; }
public string State { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
}
and provided that the all columns for address are returned back in the query result.
How can I get the Location object populated with address information .
Thank you,
Mar
if someone can help me put a label "help wanted". I am not able to find how to.
No it's not supported natively, the best way to achieve this is by returning flat objects, then mapping into your custom classes