So I have an application that uses SMB to move files within an Azure fileshare. The problem is that every time I implement a programme, I get different outcomes. I've seen that some files are being destroyed from their original locations while others are not being copied. It is working fine while I am debugging code step by step. Perhaps it's because my code is performed before my async task is completed. Here's a sample of the code I wrote:
public static class SMB
{
     public static async Task MoveFile()
    {
    ....
        await CreateNestedDirectoryIfNotExistsAsync();
    ....
    }
    private static async Task CreateNestedDirectoryIfNotExistsAsync()
    {
    ....
    }
}
I'm utilising the aforementioned code in my console application project by including the class in my reference, and then using the methods as follows:
public static class SMB
{
     public static async Task MoveFile()
    {
    ....
        await CreateNestedDirectoryIfNotExistsAsync();
    ....
    }
    private static async Task CreateNestedDirectoryIfNotExistsAsync()
    {
    ....
    }
}