Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entity-framework/core/cli/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ dotnet ef dbcontext scaffold Name=ConnectionStrings:Blogging Microsoft.EntityFra
The following example skips scaffolding an `OnConfiguring` method. This can be useful when you want to configure the DbContext outside of the class. For example, ASP.NET Core apps typically configure it in Startup.ConfigureServices.

```dotnetcli
dotnet ef dbcontext scaffold "Server=(localdb)\mssqllocaldb;Database=Blogging;User Id=myUsername;Password=myPassword;" Microsoft.EntityFrameworkCore.SqlServer --no-onconfiguring
dotnet ef dbcontext scaffold "Server=(localdb)\mssqllocaldb;Database=Blogging;User Id=myUsername;Password=--;" Microsoft.EntityFrameworkCore.SqlServer --no-onconfiguring
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is that still a legal pw?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Uh, I'm not sure - but it's the same password you had before: you had Password=-- and then an additional ;pw which wasn't part of the password, since ; is the connection string delimiter. And since pw isn't a valid option, the connection string was invalid.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Uh, I'm not sure - but it's the same password you had before: you had Password=-- and then an additional ;pw which wasn't part of the password, since ; is the connection string delimiter. And since pw isn't a valid option, the connection string was invalid.

that was my intention.

I should have added:

In the preceding code, replace --;pw; with a valid password.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See below - I agree with @cincuranet, why not just use *** as the placeholder?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If *** is a valid password you can't use it. You have to use something that can never be valid, even better if it throws exceptions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If *** is a valid password you can't use it. You have to use something that can never be valid, even better if it throws exceptions

Sorry @blowdart, I see you resolved the issue.

Comment thread
Rick-Anderson marked this conversation as resolved.
Outdated
```

## `dotnet ef dbcontext script`
Expand Down