0
是否有可能創建下面的書面短小精悍查詢,作爲IEnumerable<dynamic>
作爲我沒有產品&供應商POCO。在短小精悍連接查詢中使用動態對象列表
IEnumerable<Product> products = sqlConnection
.Query<Product, Supplier, Product>(
@"select Products.*, Suppliers.*
from Products join Suppliers
on Products.SupplierId = Suppliers.Id
and suppliers.Id = 2",
(a, s) =>
{
a.Supplier = s;
return a;
});
如果我的sql查詢是一件下面,我短小精悍的查詢將如何與IEnumerable<dynamic>
select Products.ProductId,Products.ProductName,Products.ProductCategory, ProductPrice.Amount,ProductPrice.Currency
from Products join ProductPrice
on Products.ProductId = ProductPrice.ProductId
所有幫助的返回類型是真誠的讚賞。
感謝