This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see
Cake.SqlServer.
Summary
Restores a database from a backup file.
Syntax
public static void RestoreSqlBackup(this ICakeContext context, string connectionString, FilePath backupFile)
Examples
#addin "nuget:?package=Cake.SqlServer"
Task("Restore-Database")
.Does(() =>
{
var connString = @"data source=(localdb)\MSSqlLocalDb";
var backupFile = new FilePath("C:/tmp/myBackup.bak");
RestoreSqlBackup(connString, backupFile);
});
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. |
backupFile |
FilePath |
Absolute path to .bak file |
Return Value