-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic FromSql #3187
Comments
See #1862 |
@freshe this is a known limitation of var data = db.Set<Table>()
.FromSql("SELECT * FROM table WHERE 1=1")
.Select(t => new Test {Id = t.Id})
.ToList(); Also note that until very recently there was a bug (#3142) that that would cause the projection to be evaluated in memory, but this is now fixed in nightly builds. |
Same here we use the sqlQuery method extensively throughout applications that are not rooted in the DbContext; typically to retrieve (subset) view data that is not part of the DbContext, therefore item #1862 would be invaluable |
FromSql only seems to work with classes/tables that is already mapped within your DbContext.
Is there a way/plan to make it work like the "EF6x SqlQuery generic" way?
The entity type 'Test' was not found. Ensure that the entity type has been added to the model
The text was updated successfully, but these errors were encountered: