-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Query: Make CreateReadValueExpression an extension method #20321
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
This method is to read a particular index from valueBuffer for a property. It was in EntityMaterializerSource as an instance method in order for provider to influence how values are read from valueBuffer. In new query pipeline, providers are supposed to convert valueBuffer read to their database object read. Further, even if they want to create a ValueBuffer for read, the valueBuffer should have values after all custom processing. Hence there is no particular need to make this overridable behavior. Making it extension method simplify quite a lot of things. (note: functionality to use this was available anyway since the method it invoke was also publicly exposed as static.
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Diagnostics; | ||
using Microsoft.EntityFrameworkCore.Internal; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Query; | ||
using Microsoft.EntityFrameworkCore.Storage; | ||
using Microsoft.EntityFrameworkCore.Utilities; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Infrastructure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish this class would have been named something like InternalExpressionExtensions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me too. Such a clash between our own code. 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically we could rename all internal extension method classes without it being a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but .Infrastructure
is not .Internal
Is @ajcvickers happy with making this breaking change? |
…minatorCondition If DiscriminatorCondition returns null for IEntityType then return null instance. Part of #18923
This method is to read a particular index from valueBuffer for a property.
It was in EntityMaterializerSource as an instance method in order for provider to influence how values are read from valueBuffer.
In new query pipeline, providers are supposed to convert valueBuffer read to their database object read. Further, even if they want to create a ValueBuffer for read, the valueBuffer should have values after all custom processing.
Hence there is no particular need to make this overridable behavior. Making it extension method simplify quite a lot of things.
(note: functionality to use this was available anyway since the method it invoke was also publicly exposed as static.