Skip to content

Commit

Permalink
Update hosting-sql-database-projects.md (#2168)
Browse files Browse the repository at this point in the history
* Update hosting-sql-database-projects.md

Documentation for new WithConfigureDacDeployOptions extension. Related to issue CommunityToolkit/Aspire#282 and PR CommunityToolkit/Aspire#286

* Apply suggestions from code review

---------

Co-authored-by: David Pine <[email protected]>
  • Loading branch information
nnitkasw and IEvangelist authored Dec 2, 2024
1 parent 8d68a22 commit c6b6920
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/community-toolkit/hosting-sql-database-projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,29 @@ builder.AddSqlProject("mysqlproj")
.WithReference(sql);
```

### Deployment options support

To define options that affect the behavior of package deployment, call the `WithConfigureDacDeployOptions` API:

```csharp
var builder = DistributedApplication.CreateBuilder(args);

var sql = builder.AddSqlServer("sql")
.AddDatabase("test");

builder.AddSqlProject("mysqlproj")
.WithConfigureDacDeployOptions(options => options.IncludeCompositeObjects = true)
.WithReference(sql);

builder.Build().Run();
```

The preceding code:

- Adds a SQL server resource named `sql` and adds a `test` database resource to it.
- Adds a SQL project resource named `mysqlproj` and then configures the <xref:Microsoft.SqlServer.Dac.DacDeployOptions>.
- The SQL project resource depends on the database resource.

### Redeploy support

If you make changes to your SQL Database project while the app host is running, you can use the `Redeploy` custom action on the .NET Aspire dashboard to redeploy your updates without having to restart the app host.
Expand Down

0 comments on commit c6b6920

Please sign in to comment.