You can use the multi mapping feature. Here there are some examples:
Value objects with Dapper
-
26-06-2022 - |
Question
I have an entity with an aggregated value object, like this:
public class Address {
public string Town { get; set; }
public string Street { get; set; }
public string Region { get; set; }
...
}
public class Contact {
public Int32 Id { get; set; }
public string Name { get; set; }
public Address Address { get; set; }
}
My persistence model is a single table with the following fields: Id, Name, Street, Town, Region
, ecc. Is it possible to Create/Read/Update/Delete entities in this situation with Dapper?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow