DacAliases.

ExtractDacpacFile(ICakeContext, string, string, ExtractDacpacSettings) Method

Summary

Extracts a dacpac file to a database package.
Assembly
Cake.SqlServer.dll
Namespace
Cake.SqlServer
Containing Type
DacAliases

Syntax

public static void ExtractDacpacFile(this ICakeContext context, string connectionString, string targetDatabaseName, ExtractDacpacSettings settings)

Examples

    #addin "nuget:?package=Cake.SqlServer"

    Task("Extract-Dacpac")
    	.Does(() =>{
    		var connString = @"data source=(localdb)\MSSqlLocalDb";
    
    		var dbName = "ForDacpac";
    
    		CreateDatabase(connString, dbName);

    		var settings = new ExtractDacpacSettings("MyAppName", "2.0.0.0") { 
    			OutputFile = new FilePath(@".\TestData\Nsaga.dacpac")
			};
    
    		ExtractDacpacFile(connString, dbName, settings);
    	});
    });        

Attributes

Type Description
CakeMethodAliasAttribute

Parameters

Name Type Description
context ICakeContext The Cake context.
connectionString string The connection string.
targetDatabaseName string Name of the database you'd like to extract a package from
settings ExtractDacpacSettings Custom setting for the extract operation.

Return Value

Type Description
void