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

Update scaffolding.md #3944

Merged
merged 2 commits into from
Aug 2, 2022
Merged

Update scaffolding.md #3944

merged 2 commits into from
Aug 2, 2022

Conversation

Rick-Anderson
Copy link
Contributor

Fixes #3939

@@ -37,11 +37,12 @@ Scaffold-DbContext 'Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Chinook'

### Configuration and User Secrets

If you have an ASP.NET Core project, you can use the `Name=<connection-string>` syntax to read the connection string from configuration.
If you have a .NET or ASP.NET Core project, you can use the `Name=<connection-string>` syntax to read the connection string from configuration.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this is helpful. This syntax will only work with .NET applications that are using D.I. and configuration. Usually, this means only ASP.NET Core projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure this is helpful. This syntax will only work with .NET applications that are using D.I. and configuration. Usually, this means only ASP.NET Core projects.

The configuration system is .NET, not just ASP.NET Core. See this comment with a snippet

Copy link
Member

Choose a reason for hiding this comment

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

Understood, but how many people use it outside of ASP.NET Core? Which other templates use it by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood, but how many people use it outside of ASP.NET Core? Which other templates use it by default?

Plenty of folks who are reverse engineering the DB once they know it works with .NET. As written, the implication is it doesn't work outside of ASP.NET Core and you can't use user secrets with .NET console apps, which is not correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See Dependency injection in .NET

It's not just ASP.NET Core.

Copy link
Member

Choose a reason for hiding this comment

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

How about, "If you have a .NET application that uses the hosting model and configuration system, such as an ASP.NET Core project, then you can use the Name=<connection-string> syntax to read the connection string from configuration."

Copy link
Contributor

Choose a reason for hiding this comment

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

such as an ASP.NET Core or Worker Service project

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ericstj @IEvangelist please review wording for using configuration with .NET

Copy link
Member

Choose a reason for hiding this comment

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

I think @ajcvickers wording sounds OK. Would it help to provide a link to hosting model and configuration system? cc @dotnet/area-extensions-hosting @dotnet/area-extensions-configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ericstj changed it to @ajcvickers suggestion. I don't get why we make it sound like .NET doesn't support this.

@ajcvickers ajcvickers merged commit 5e1087c into main Aug 2, 2022
@smitpatel smitpatel deleted the Rick-Anderson-patch-1 branch November 2, 2022 20:50
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.

Reverse Engineering Page is Unclear On Utilizing User Secrets
4 participants