-
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
Error when we use owned type as a alternate key. #13566
Comments
Hi @ajcvickers Of course, I can explain you. We have our own Id, but these two properties need be unique, because they are the compose key of legacy software that we need to integrate with our app and of course, we need to use Find to retrieve the products by this key because the legacy system it doesn't know our Id and send us the compose key. Regards! |
@lurumad Given that Find doesn't work with alternate keys, does this change? Do you really need this to be the primary key? |
Hi @ajcvickers Ok, we can find using a LINQ expresion without using Find but we need to make unique { p.ProductTypeId, p.ProductNumber.value } Is that possible? Regards! |
Hi folks,
Given the next model:
ProductNumber and ProductTypeId need to be alternate key, so if a try to configure like this:
We received this error:
Further technical details
EF Core version: 2.1.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10 Enterprise 1803
IDE: Microsoft Visual Studio Enterprise 2017
Version 15.8.5
VisualStudio.15.Release/15.8.5+28010.2036
Microsoft .NET Framework
Version 4.7.03056
Any ideas?
The text was updated successfully, but these errors were encountered: