-
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
InMemory: Defining query with shadow props #20023
Labels
closed-out-of-scope
This is not something that will be fixed/implemented and the issue is closed.
Comments
This was referenced Mar 10, 2020
Open
AndriySvyryd
changed the title
InMemory: Defining query for keyless entities
InMemory: Defining query with shadow props
Jul 14, 2020
Blocked on #21624 |
12 tasks
ajcvickers
added
propose-close
closed-out-of-scope
This is not something that will be fixed/implemented and the issue is closed.
and removed
type-enhancement
blocked
propose-close
area-in-memory
labels
Oct 20, 2022
We recommend against using the in-memory provider for testing--see Testing EF Core Applications. While we have no plans to remove the in-memory provider, we will not be adding any new features to this provider because we believe valuable development time is better spent in other areas. When feasible, we plan to still fix regressions in existing behavior. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-out-of-scope
This is not something that will be fixed/implemented and the issue is closed.
Current we have ToQuery method which has it's own issues in InMemory. Notably, #17158. Further, in current mechanism there is no way to specify shadow properties. But on the other hand, a keyless entity can still have shadow property.
With relational model coming into picture in 5.0 and mapping to view or ToQuerySql, for testing purposes of the views we can add following to InMemory provider,
The anonymous type construction must have all the properties defined on BlogView. (Even if it is always null does not matter). (Same as what we do for views/tables/FromSql).
We would take this defining query, compile it fully to generate enumerable of ValueBuffers where slots in ValueBuffers are sorted as we expect properties to come and substitute it for following method.
efcore/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.cs
Lines 84 to 87 in 1700908
The ToQuery method can also take a static list of values and project into anonymous type form we want and we can use that as source too. In a way, it would provide readonly data.
Due to implementation, scope of this should only be InMemory provider. This would make testing keyless entities in cross database scenario a lot simple and make feature more useful.
The text was updated successfully, but these errors were encountered: