Skip to content

Commit

Permalink
Add connection string for the database in appsettings.json for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sthsuyash committed May 31, 2024
1 parent 2ecaf9e commit 2171df8
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,23 @@
});
```

6. Create a migration to generate the database schema.
6. In `appsettings.json` file, add the connection string for the database.

```csharp
{
"ConnectionStrings":{
"connectionString": "Server=Servername; Database=DatabaseName; Trusted_Connection=True;"
}
}
```

7. Create a migration to generate the database schema.

- Open the Package Manager Console.
- Run the command `Add-Migration "Initial"` to create a migration.
- Run the command `Update-Database` to apply the migration and create the database.

7. Use the DbContext in a controller to query and save data.
8. Use the DbContext in a controller to query and save data.

## CRUD Operations

Expand Down

0 comments on commit 2171df8

Please sign in to comment.