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

Add Comment to DatabaseColumn and DatabaseTable #16379

Merged
merged 3 commits into from
Jul 18, 2019

Conversation

ErikEJ
Copy link
Contributor

@ErikEJ ErikEJ commented Jul 1, 2019

and Scaffold comment from SQL Server MS_Description

Part of #16305

Copy link
Contributor

@ajcvickers ajcvickers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. @bricelam Do you want to review?

Copy link
Contributor

@bricelam bricelam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add the corresponding code in RelationalScaffoldingModelFactory.VisitColumn to the same PR. Seems incomplete to query for it and not use it.

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jul 2, 2019

@bricelam Question: For scaffolding with DataAnnotations, is the plan to use [Description] attribute?

@bricelam
Copy link
Contributor

bricelam commented Jul 2, 2019

I don't think we have a corresponding annotation yet; we should file an issue. So the plan for now would be to scaffold HasComment always (whether -DataAnnotations is specified or not)

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jul 7, 2019

@bricelam I have updated RelationalScaffoldingModelFactory - but unsure if those changes are enough - and fail to find a relevant test.

@bricelam
Copy link
Contributor

bricelam commented Jul 8, 2019

Thanks! I'll look into testing

@bricelam bricelam force-pushed the issue-16305-part1 branch from b62aae0 to 1dbdc87 Compare July 8, 2019 19:47
@bricelam
Copy link
Contributor

bricelam commented Jul 8, 2019

(Added some tests, made C# generation better, and rebased)

@bricelam
Copy link
Contributor

bricelam commented Jul 8, 2019

Ah, just realized this is for entity type too 😄 Want to add tests for those and fix that C#?

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jul 12, 2019

@bricelam I have tried 🤡

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jul 12, 2019

But tests are failing..

@@ -159,13 +159,32 @@ public void Comments_use_fluent_api()
}),
new ModelCodeGenerationOptions(),
code => Assert.Contains(
".HasColumn(\"An int property\")",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂ My bad.

@bricelam bricelam force-pushed the issue-16305-part1 branch from 93d6298 to cda0092 Compare July 12, 2019 18:05
@bricelam
Copy link
Contributor

Updated. We needed to pass the fully-qualified name to FindEntityType

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jul 12, 2019

Great!!!

@ErikEJ
Copy link
Contributor Author

ErikEJ commented Jul 13, 2019

Updated - test failures seem unrelated

ErikEJ and others added 3 commits July 18, 2019 08:43
Scaffold comment from SQL Server MS_Description
Add test and fix test
Fix wrong class name
Add missing test
@bricelam bricelam force-pushed the issue-16305-part1 branch from e039e15 to 1c675ca Compare July 18, 2019 15:45
@bricelam bricelam merged commit 1c675ca into dotnet:master Jul 18, 2019
@ErikEJ ErikEJ deleted the issue-16305-part1 branch July 22, 2019 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants