-
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
Enable flexible FromSql mapping #21627
Comments
In your second example, you did mean? var deletedBlogs = context.Set<Blog>().FromNamedSqlRaw("GetDeletedBlogs",
"select id, name from Blogs where Deleted={0}",
true)
.ToList(); I suppose that Blog class have Id and Name properties, and should be filled by convection through sql fields and class property's names, correct? |
@ircnelson No, the example shows that column names can be customized for raw SQL queries without affecting the table to which the entity type is also mapped. |
Also add a note to the |
Also consider API to mark the SQL as non-composable so we would run it as-is. |
This builds upon #17063, #13358 to enable different mappings for different SQL queries and to allow parameter configuration. This would also support JSON columns.
It would be configured like so:
And used like so:
or
The text was updated successfully, but these errors were encountered: