Skip to content
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

SqlServer RevEng: Handle included index columns #22148

Merged
1 commit merged into from
Aug 20, 2020

Conversation

bricelam
Copy link
Contributor

Fixes #17083

@bricelam bricelam requested a review from a team August 20, 2020 17:42
@ghost
Copy link

ghost commented Aug 20, 2020

Hello @bricelam!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@smitpatel
Copy link
Member

I was curious.
So when I use lambda based IncludeProperties, the annotation contains property names. If those properties are mapped to different column name, we handle it somewhere (couldn't find in source code yet).
In above we are storing column names rather than property names. Property names could be something different if column name is not valid C# identifier. Where & how that would be handled so that everything aligns properly?

@bricelam
Copy link
Contributor Author

lol, probably a bug. See also #14087

@smitpatel
Copy link
Member

Looks like changes from #14087 are moved. I verified in a console app that we do remapping just don't know where. If we have remapping mechanism then probably reveng also need to remap column names to generate property names when apply annotation to IModel.

@bricelam
Copy link
Contributor Author

bricelam commented Aug 20, 2020

Hmm, I wonder where would that code would go. We don't know the property names here, and the model generator just blindly copies provider-specific annotations.

@AndriySvyryd
Copy link
Member

var includeColumns = (IReadOnlyList<string>)includeProperties

@bricelam
Copy link
Contributor Author

That handles IIndex -> ITableIndex, but I don't think we have a provider hook for the inverse. I'll file an issue.

@AndriySvyryd
Copy link
Member

We would need a provider-specific reveng annotation processor

@bricelam
Copy link
Contributor Author

Ugg, adding tests that assert bugs is definitely an anti-pattern.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scaffold Sql Server Database fail on index with include columns
3 participants