我的課是:如何包含一個在dapper中具有通用列表屬性和引用類型屬性的對象?
public class Person
{
public int Id { get; set; }
public string Name { get; set; }
public List<Address> Addresses { get; set; }
public BankAccount Account { get; set; }
}
public class Address
{
public string Street { get; set; }
public string City { get; set; }
public string Zipcode { get; set; }
}
public class BankAccount
{
public decimal Balance {get; set;}
public DateTime LastDateWithdrawn { get; set;}
}
它不可能multimapping或多個結果我已經嘗試過。 你是如何做到這一點的小巧玲瓏? 我想要實現的不是往返數據庫的往返取得地址和銀行賬戶,如果我可以使用多重映射或多重結果或任何其他選項。
通過看你的課,它很難幫助你。向我們展示你迄今爲止做了什麼。你想要達到什麼? –
@KrishnrajRana我編輯了我的問題..謝謝! –
好吧,這意味着你想獲得多個結果集並將其綁定到** Person **類的權利? –