Mutiple Resultset in EF Core 1.0

entity-framework-core

Question

Does Entity Framework Core 1.0 Support multiple result set? If so can you give please give an example based on the below stored procedure?

CREATE PROCEDURE uspGetProductInfo
AS
BEGIN
     SELECT ID,PRODUCT_NAME FROM PRODUCT
     SELECT ID,CATEGORY_NAME FROM PRODUCT_CATEGORY   
END
1
0
8/17/2016 12:40:59 PM

Accepted Answer

What kind of support are you looking for? You can certainly drop-down to 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();
}
2
8/17/2016 4:56:43 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow