DatabaseUtilsCreateFileContentBeforeConnectTransaction Method (IDatabaseRepository, String, String, Int32) |
Namespace: PDTec.IceNet.Sdk.Utils
public static string CreateFileContentBeforeConnectTransaction( IDatabaseRepository pRepository, string vaultName, string filePath, int maxChunkSize = 10485760 )
The example shows how to use the CreateFileContentBeforeConnectTransaction(IDatabaseRepository, String, String, Int32) method to create a file content and connect this file content in a database transaction.
// // First step: create a FileContent record... // string contentUuid = DatabaseUtils.CreateFileContentBeforeConnectTransaction(Repository, "System.Database", "koala.jpg"); // // Final step: Create the File object and connect the FileContent as a new content version... // IFile pFile = null; Repository.ExecuteTransaction(delegate { pFile = Repository.GetObjTypeByName("Core.File").Create<IFile>(Repository.RootFolder, "F1", ""); pFile.ConnectContent(true, "", "koala.jpg", contentUuid); });