Entity Framework Core 1.0是否支持多个结果集? 如果是这样,请给出一个基于以下存储过程的例子吗?
CREATE PROCEDURE uspGetProductInfo
AS
BEGIN
SELECT ID,PRODUCT_NAME FROM PRODUCT
SELECT ID,CATEGORY_NAME FROM PRODUCT_CATEGORY
END
答案 0 :(得分:2)
您在寻找什么样的支持?你当然可以下载到ADO.NET。
var command = db.Database.GetDbConnection().CreateCommand();
command.CommandText = "uspGetProductInfo";
db.Database.OpenConnection();
try
{
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
// TODO: Read products
}
reader.NextResult();
while (reader.Read())
{
// TODO: Read product categories
}
}
}
finally
{
db.Database.CloseConnection();
}