SqlProjectBuilderExtensions Methods
ClassMethods15 members
Provides extension methods for adding SQL Server Database Projects to the application.
AddSqlPackage(IDistributedApplicationBuilder, string)Section titled AddSqlPackage(IDistributedApplicationBuilder, string)extensionIResourceBuilder<SqlPackageResource<TPackage>> Adds a SQL Server Database Project resource to the application based on a referenced NuGet package.
public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlPackageResource<TPackage>> AddSqlPackage<TPackage>( this IDistributedApplicationBuilder builder, string name) { // ... }}Parameters
builderIDistributedApplicationBuilderAn Hosting.IDistributedApplicationBuilder instance to add the SQL Server Database project to.namestringName of the resource.Returns
IResourceBuilder<SqlPackageResource<TPackage>>Am ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This method is not available in polyglot app hosts.
AddSqlProject(IDistributedApplicationBuilder, string)Section titled AddSqlProject(IDistributedApplicationBuilder, string)extensionIResourceBuilder<SqlProjectResource> Adds a SQL Server Database Project resource to the application based on a referenced MSBuild.Sdk.SqlProj project.
public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> AddSqlProject<TProject>( this IDistributedApplicationBuilder builder, string name) { // ... }}Parameters
builderIDistributedApplicationBuilderAn Hosting.IDistributedApplicationBuilder instance to add the SQL Server Database project to.namestringName of the resource.Returns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This overload is not available in polyglot app hosts. Use
SqlProjectBuilderExtensions.AddSqlProject and then call WithDacpac instead.AddSqlProject(IDistributedApplicationBuilder, string)Section titled AddSqlProject(IDistributedApplicationBuilder, string)extensionIResourceBuilder<SqlProjectResource> Adds a SQL Server Database Project resource to the application.
public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> AddSqlProject( this IDistributedApplicationBuilder builder, string name) { // ... }}Parameters
builderIDistributedApplicationBuilderAn Hosting.IDistributedApplicationBuilder instance to add the SQL Server Database project to.namestringName of the resource.Returns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.WithConfigureDacDeployOptions(IResourceBuilder<SqlProjectResource>, Action<DacDeployOptions>)Section titled WithConfigureDacDeployOptions(IResourceBuilder<SqlProjectResource>, Action<DacDeployOptions>)extensionIResourceBuilder<SqlProjectResource> Adds a delegate annotation for configuring dacpac deployment options to the
SqlProjectResource. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> WithConfigureDacDeployOptions( this IResourceBuilder<SqlProjectResource> builder, Action<DacDeployOptions> configureDeploymentOptions) { // ... }}Parameters
builderIResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.configureDeploymentOptionsAction<DacDeployOptions>The delegate for configuring dacpac deployment optionsReturns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This method is not available in polyglot app hosts. Use
SqlProjectBuilderExtensions.WithDacDeployOptions instead.WithConfigureDacDeployOptions(IResourceBuilder<SqlPackageResource<TPackage>>, Action<DacDeployOptions>)Section titled WithConfigureDacDeployOptions(IResourceBuilder<SqlPackageResource<TPackage>>, Action<DacDeployOptions>)extensionIResourceBuilder<SqlPackageResource<TPackage>> Adds a delegate annotation for configuring dacpac deployment options to the
SqlProjectResource. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlPackageResource<TPackage>> WithConfigureDacDeployOptions<TPackage>( this IResourceBuilder<SqlPackageResource<TPackage>> builder, Action<DacDeployOptions> configureDeploymentOptions) { // ... }}Parameters
builderIResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.configureDeploymentOptionsAction<DacDeployOptions>The delegate for configuring dacpac deployment optionsReturns
IResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This method is not available in polyglot app hosts.
WithDacDeployOptions(IResourceBuilder<SqlProjectResource>, string)Section titled WithDacDeployOptions(IResourceBuilder<SqlProjectResource>, string)extensionIResourceBuilder<SqlProjectResource> Adds a path to a publish profile for configuring dacpac deployment options to the
SqlProjectResource. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> WithDacDeployOptions( this IResourceBuilder<SqlProjectResource> builder, string optionsPath) { // ... }}Parameters
builderIResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.optionsPathstringPath to the publish profile xml fileReturns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.WithDacDeployOptions(IResourceBuilder<SqlPackageResource<TPackage>>, string)Section titled WithDacDeployOptions(IResourceBuilder<SqlPackageResource<TPackage>>, string)extensionIResourceBuilder<SqlPackageResource<TPackage>> Adds a path to a publish profile for configuring dacpac deployment options to the
SqlProjectResource. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlPackageResource<TPackage>> WithDacDeployOptions<TPackage>( this IResourceBuilder<SqlPackageResource<TPackage>> builder, string optionsPath) { // ... }}Parameters
builderIResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.optionsPathstringPath to the publish profile xml fileReturns
IResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This overload is not available in polyglot app hosts.
WithDacpac(IResourceBuilder<SqlProjectResource>, string)Section titled WithDacpac(IResourceBuilder<SqlProjectResource>, string)extensionIResourceBuilder<SqlProjectResource> Specifies the path to the .dacpac file.
public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> WithDacpac( this IResourceBuilder<SqlProjectResource> builder, string dacpacPath) { // ... }}Parameters
builderIResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.dacpacPathstringPath to the .dacpac file.Returns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.WithDacpac(IResourceBuilder<SqlPackageResource<TPackage>>, string)Section titled WithDacpac(IResourceBuilder<SqlPackageResource<TPackage>>, string)extensionIResourceBuilder<SqlPackageResource<TPackage>> Specifies the path to the .dacpac file.
public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlPackageResource<TPackage>> WithDacpac<TPackage>( this IResourceBuilder<SqlPackageResource<TPackage>> builder, string dacpacPath) { // ... }}Parameters
builderIResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.dacpacPathstringPath to the .dacpac file.Returns
IResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This overload is not available in polyglot app hosts.
WithReference(IResourceBuilder<SqlProjectResource>, IResourceBuilder<SqlServerDatabaseResource>)Section titled WithReference(IResourceBuilder<SqlProjectResource>, IResourceBuilder<SqlServerDatabaseResource>)extensionIResourceBuilder<SqlProjectResource> Publishes the SQL Server Database project to the target
ApplicationModel.SqlServerDatabaseResource. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> WithReference( this IResourceBuilder<SqlProjectResource> builder, IResourceBuilder<SqlServerDatabaseResource> target) { // ... }}Parameters
builderIResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project to publish.targetIResourceBuilder<SqlServerDatabaseResource>An ApplicationModel.IResourceBuilder`1 representing the target ApplicationModel.SqlServerDatabaseResource to publish the SQL Server Database project to.Returns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.WithReference(IResourceBuilder<SqlProjectResource>, IResourceBuilder<IResourceWithConnectionString>)Section titled WithReference(IResourceBuilder<SqlProjectResource>, IResourceBuilder<IResourceWithConnectionString>)extensionIResourceBuilder<SqlProjectResource> Publishes the SQL Server Database project to the target
ApplicationModel.IResourceWithConnectionString. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> WithReference( this IResourceBuilder<SqlProjectResource> builder, IResourceBuilder<IResourceWithConnectionString> target) { // ... }}Parameters
builderIResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project to publish.targetIResourceBuilder<IResourceWithConnectionString>An ApplicationModel.IResourceBuilder`1 representing the target ApplicationModel.IResourceWithConnectionString to publish the SQL Server Database project to.Returns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.WithReference(IResourceBuilder<SqlPackageResource<TPackage>>, IResourceBuilder<SqlServerDatabaseResource>)Section titled WithReference(IResourceBuilder<SqlPackageResource<TPackage>>, IResourceBuilder<SqlServerDatabaseResource>)extensionIResourceBuilder<SqlPackageResource<TPackage>> Publishes the SQL Server Database project to the target
ApplicationModel.SqlServerDatabaseResource. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlPackageResource<TPackage>> WithReference<TPackage>( this IResourceBuilder<SqlPackageResource<TPackage>> builder, IResourceBuilder<SqlServerDatabaseResource> target) { // ... }}Parameters
builderIResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project to publish.targetIResourceBuilder<SqlServerDatabaseResource>An ApplicationModel.IResourceBuilder`1 representing the target ApplicationModel.SqlServerDatabaseResource to publish the SQL Server Database project to.Returns
IResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This overload is not available in polyglot app hosts.
WithReference(IResourceBuilder<SqlPackageResource<TPackage>>, IResourceBuilder<IResourceWithConnectionString>)Section titled WithReference(IResourceBuilder<SqlPackageResource<TPackage>>, IResourceBuilder<IResourceWithConnectionString>)extensionIResourceBuilder<SqlPackageResource<TPackage>> Publishes the SQL Server Database project to the target
ApplicationModel.IResourceWithConnectionString. public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlPackageResource<TPackage>> WithReference<TPackage>( this IResourceBuilder<SqlPackageResource<TPackage>> builder, IResourceBuilder<IResourceWithConnectionString> target) { // ... }}Parameters
builderIResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project to publish.targetIResourceBuilder<IResourceWithConnectionString>An ApplicationModel.IResourceBuilder`1 representing the target ApplicationModel.IResourceWithConnectionString to publish the SQL Server Database project to.Returns
IResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This overload is not available in polyglot app hosts.
WithSkipWhenDeployed(IResourceBuilder<SqlProjectResource>)Section titled WithSkipWhenDeployed(IResourceBuilder<SqlProjectResource>)extensionIResourceBuilder<SqlProjectResource> Specifies that .dacpac deployment should be skipped if metadata in the target database indicates that the .dacpac has already been deployed in its current state.
public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlProjectResource> WithSkipWhenDeployed( this IResourceBuilder<SqlProjectResource> builder) { // ... }}Parameters
builderIResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.Returns
IResourceBuilder<SqlProjectResource>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.WithSkipWhenDeployed(IResourceBuilder<SqlPackageResource<TPackage>>)Section titled WithSkipWhenDeployed(IResourceBuilder<SqlPackageResource<TPackage>>)extensionIResourceBuilder<SqlPackageResource<TPackage>> Specifies that .dacpac deployment should be skipped if metadata in the target database indicates that the .dacpac has already been deployed in its current state.
public static class SqlProjectBuilderExtensions{ public static IResourceBuilder<SqlPackageResource<TPackage>> WithSkipWhenDeployed<TPackage>( this IResourceBuilder<SqlPackageResource<TPackage>> builder) { // ... }}Parameters
builderIResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 representing the SQL Server Database project.Returns
IResourceBuilder<SqlPackageResource<TPackage>>An ApplicationModel.IResourceBuilder`1 that can be used to further customize the resource.Remarks
This overload is not available in polyglot app hosts.