BcpServiceBuilder Class

A factory that creates the BcpService with the relevant settings.

Namespace: bcpDevKit
Assembly: bcpDevKit.dll

Inheritance Hierarchy

System.Object
 bcpDevKit.IBcpServiceBuilder
  bcpDevKit.BcpServiceBuilder

Syntax

public class BcpServiceBuilder : IBcpServiceBuilder

Properties

Type

Name

Description

../../../_images/prop.ico BcpVersion

Version

Gets or sets the vault version for which you want to create a BCP package. The default version is BcpVersion._2024.

../../../_images/prop.ico DirectoryInfo

PackageDirectory

Gets or sets the output folder where it will create the BCP package.

Methods

Type

Name

Description

../../../_images/method.ico void

SetPackageLocation(string packageLocation)

Assigns the specified path to the PackageDirectory.

../../../_images/method.ico IBcpService

Build()

Creates a new IBcpService with the relevant settings.

Remarks

The PackageDirectory is set by default to the TEMP directory on your computer. More details on its determination can be found here.
SetPackageLocation throws an exception of type DirectoryNotFoundException when an invalid path is passed to the function.

Examples

Create a new BCP package and add files

using bcpDevKit; using bcpDevKit.Entities;

class Program
{
	static void Main(string[] args)
	{
	        var bcpSvcBuilder = new BcpServiceBuilder {Version = BcpVersion._2024};
	        bcpSvcBuilder.SetPackageLocation(@"C:\Temp\Package1");
	        var bcpSvc = bcpSvcBuilder.Build();

	        var catchAssembly = bcpSvc.FileService.AddFileWithIteration("$/Designs/Catch Assembly.iam", @"C:\Catch Assembly.iam");
	        bcpSvc.Flush();
	}
}