我有一个客户说我使用了Dapper ORM,这是我以前从未使用过的.我有嵌套对象的问题.我有一个主类(Location),它有一个嵌入式值对象类(Address).这两个类看起来像这样:
class Location {
int Id;
string LocationName;
Address LocationAddress;
}
Class Address {
string Street;
string City;
string State;
string ZipCode;
}
Run Code Online (Sandbox Code Playgroud)
SQL:
SELECT Id, LocationName, Street, City, State, ZipCode FROM Locations
Run Code Online (Sandbox Code Playgroud)
我看了一些例子,但我无法正确设置查询.我只是不明白Dapper足以使结构正确.