-
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
HasKey() on an overridden property ignores Column name attribute #22092
Labels
area-model-building
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Comments
@AndriySvyryd I am able to reproduce this on a 5.0 daily. In 3.1, the table mapped is: CREATE TABLE [dbo].[tables] (
[Object_id] int NOT NULL IDENTITY,
[Name] nvarchar(max) NULL,
[Schema_id] int NOT NULL,
CONSTRAINT [PK_tables] PRIMARY KEY ([Object_id])
); But in 5.0 it is: CREATE TABLE [dbo].[tables] (
[ObjectId] int NOT NULL IDENTITY,
[Name] nvarchar(max) NULL,
[Schema_id] int NOT NULL,
CONSTRAINT [PK_tables] PRIMARY KEY ([ObjectId])
); |
AndriySvyryd
added a commit
that referenced
this issue
Aug 25, 2020
AndriySvyryd
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Aug 25, 2020
AndriySvyryd
added a commit
that referenced
this issue
Aug 25, 2020
AndriySvyryd
added a commit
that referenced
this issue
Aug 25, 2020
Now it works for me too :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-model-building
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
When specifying HasKey() for an overridden property the column name attribute is ignored.
Steps to reproduce
In the following code sample, toggle the HasKey() in DbContext.
When it's commented out - it works as expected.
When present - you get an exception: "Invalid column name 'ObjectId'."
It works in EF 3.1.
The text was updated successfully, but these errors were encountered: