-
Notifications
You must be signed in to change notification settings - Fork 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
Update scaffolding.md #3944
Update scaffolding.md #3944
Conversation
@@ -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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Fixes #3939