I decided to migrate one of my projects to Entity Framework 7 (rc1-final). I am targeting SQL Server and the EntityFramework.MicrosoftSqlServer package EntityFramework.MicrosoftSqlServer also installed.
I have only one problem: it seems that I cannot execute a custom SQL query to get some objects from the database.
An object
DatabaseFacade (which can be accessed through the DbContext.Database property) provides the ExecuteSqlCommand extension ExecuteSqlCommand (which returns nothing), but it does not provide the SqlQuery<T> method, which allows you to retrieve objects. Both methods were available in the good old EF 6, but the new EF 7 announces only the first.
So, is the SqlQuery<T> method still here (but moved / renamed) or completely removed from the new EF implementation?
Of course, it can be solved in some detail (using SqlCommand and its ExecuteReader method), but I prefer to avoid this.
source share