The ConnectAsync method allows you to establish a connection to FileRepositoryService in the server machine.
Namespace – ABSuite.AccessLayer.Connector.Core
Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)
Syntax
Task<bool> ConnectAsync(
FileRepositoryConnectionDetails details
)Argument
details – ABSuite.AccessLayer.Connector.Core.FileRepositoryConnectionDetail
This argument provides the connection details for FileRepositoryService.
Return Value
If this method succeeds in establishing a connection, it returns true; otherwise, it returns false.
Using the IFileRepositoryService Interface for the ConnectAsync Method
The following code is an example of using the ConnectAsync method:
// Declare the FileRepositoryService
IFileRepositoryService fileRepos = FileRepositoryServiceFactory.Create();
// Specify the connection details for the repository access
ConnectionDetails fDetails = new ConnectionDetails();
fDetails.FileRepositoryDirectory = "\\\\MyMachineName\\FREPOS";
// Connect to the File Repository Service
fileRepos.Connect(fDetails).ContinueWith((t) =>
{
bool isConnected = t.Result;
}