Description
Yes, you can !;) You can execute a raw SQL query using DbCommand in the Entity Framework Code First too.
You can execute queries with multiple result sets and move on to the next result set using the NextResult() method of the SqlDataReader class.
Example
namespace MyNamespace { public class MyDbContext : DbContext { } public class Test { public void Test() { MyDbContext context = new MyDbContext(); DbCommand db = context.Database.Connection.CreateCommand(); db.CommandText = "SELECT propertie1 FROM Table1; SELECT propertie1 from Table2"; try { DbDataReader reader = db.ExecuteReader(); while (reader.Read()) {
Additional Information
source share