DacAliases.

CreateBacpacFile(ICakeContext, string, string, FilePath) Method

Summary

Creates a bacpac file for easy database backuping.
Assembly
Cake.SqlServer.dll
Namespace
Cake.SqlServer
Containing Type
DacAliases

Syntax

public static void CreateBacpacFile(this ICakeContext context, string connectionString, string databaseName, FilePath resultingFilePath)

Examples

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

    Task("Create-Bacpac")
    	.Does(() =>{
    		var connString = @"data source=(localdb)\MSSqlLocalDb";
    
    		var dbName = "ForBacpac";
    
    		CreateDatabase(connString, dbName);
    
    		CreateBacpacFile(connString, dbName, new FilePath(@".\ForBacpac.bacpac"));
    	});
    });        

Attributes

Type Description
CakeMethodAliasAttribute

Parameters

Name Type Description
context ICakeContext The Cake context.
connectionString string The connection string. You may want to connect to master database for this operation.
databaseName string Name of the database you'd like to create a bacpac from
resultingFilePath FilePath Full path where you'd like to store resulting bacpac

Return Value

Type Description
void