-
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
Unable to translate set operation when matching columns on both sides have different store types #24707
Comments
Duplicate of #19129 |
@roji If I remove the assignment of the Name variable, the following exception will appear. How do I set the default value? System.InvalidOperationException:“Unable to translate set operation when both sides don't assign values to same properties in the nominal type. Please make sure that the properties are inclued on both sides, consider assigning default value if the property doesn't require a specific value.” |
You can't perform a set operation over different properties - SQL requires the same set of properties on both sides. Unfortunately, set operations are somewhat limited at the moment... @smitpatel note that in the above a constant is being used (and not a column with a different facet). |
Since constant has nowhere to infer type mapping it uses |
It may be correct in this case to infer the constant mapping from the column on the other side of the set operation, like how we do with binary operators. But this can be done as part of #19129 when the time comes... |
Those are orthogonal concepts and it is responsibility of set operations to align the types across column, which is what #19129 tracks specifically. |
Include your code
Include stack traces
Include provider and version information
EF Core version:5.0.5
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 5.0
Operating system:win 10
IDE: Visual Studio 2019 16.9
The text was updated successfully, but these errors were encountered: