I am using DFS.NET Productivity layer v6.7.
I have variables dataObject
and repoFolderPath
.
I want to save dataObject
inside the folder specified by the path repoFolderPath
.
I can do this in two ways:
By setting i_folder_id:
dataObject.Properties.Set<String[]>("i_folder_id", new String[] { repoFolderPath } );
By using DFS .NET API:
ObjectPath objectPath = new ObjectPath(repoFolderPath); ObjectIdentity linkFolderIdentity = new ObjectIdentity(objectPath, repositoryName); ReferenceRelationship linkFolderRelationship = new ReferenceRelationship(); linkFolderRelationship.Name = Relationship.RELATIONSHIP_FOLDER; linkFolderRelationship.Target = linkFolderIdentity; linkFolderRelationship.TargetRole = Relationship.ROLE_PARENT; dataObject.Relationships.Add(linkFolderRelationship);
Q. What difference it will make if I choose one above other apart from the fact that in first approach I can use i_folder_id
and in second approach I can use repoFolderPath
? Will the second set of lines ultimately result in setting i_folder_id
, or will do something more in addition to it?
Obviously for saving dataObject
to the repository I am doing following in both the cases:
DataPackage dataPackage = new DataPackage(dataObject);
OperationOptions operationOptions = null;
DataPackage resultPackage = objectService.Create(dataPackage, operationOptions);