Say I have an object:
class Person {
public int Id {get; set;}
public string Name {get; set;}
public Address HomeAddress {get; set;};
}
class Address {
public string Street {get; set;}
public string City {get; set;}
}
I want/need the above object to be mapped to a single column named Person
which has a column named HomeAddress
whose content is a JSON (or some custom binary serialization).
How do I tell NPoco Database object to use such mapping?
You would use the [SerializedColumn] attribute on the HomeAddress property of the Person class. This will serialize/deserialize json text that is stored in the column.