I have a method that uses an client SDK (sensenet) to make requests Sensenet.
private static async Task CreateFolder(String parentPath, String folderName)
{
SensenetRepository.WriteLog(typeof(SensenetRepository).Name, "Init CreateFolder: " + parentPath + "/" + folderName);
var folder = Content.CreateNew(parentPath, "Folder", folderName);
await folder.SaveAsync();
}
I have to integrate this on my current api that is fully synchronous. (Do it all asynchronous will require a big changes on the clients and on the structure of the project)
To run "CreateFolder" synchronous, I'm calling like this:
CreateFolder(pathEntity, fileDate).Wait(); //seems to not stop here
//more code to execute after createFolder...
On CreateFolder execution it seems that is running asynchronous despite having Wait() calling.
I'm having difficult to call CreateNew method from Sensenet Client, since the save is always "SaveAsync".