I have 2 classes, Order and Address as following:
public class Order
{
public string OrderId { get; set; }
public Address ShippingAddress { get; set; }
public Address BillingAddress { get; set; }
}
and
public class Address
{
public string Street { get; set; }
public string Town { get; set; }
public string Zip { get; set; }
}
The database stores the orders and address in a single table like this:
CREATE TABLE Orders
(
OrderId NVARCHAR(56) PRIMARY KEY,
BillingStreet NVARCHAR(256),
BillingTown NVARCHAR(256),
BillingZip NVARCHAR(256),
ShippingStreet NVARCHAR(256),
ShippingTown NVARCHAR(256),
ShippingZip NVARCHAR(256)
)
How can i get dapper to map this to the Order class?
