I
IndigoMontoya
Guest
What is the proper way to code this?
class FirstClass
{
public static async Task Main(string[] args)
{
bool fileDownloaded = await GetFilesFromShareFile();
if (fileDownloaded == true)
{
method1();
method2();
method3();
method4();
method5();
}
else
{
return;
}
}
}
if (fileDownloaded)
{
method1();
method2();
method3();
method4();
method5();
}
class SecondClass
{
public static async Task<bool> GetFilesFromShareFile()
{
bool fileDownloaded = await GrabTheFile();
if (fileDownloaded = true)
{
return true;
}
else
{
return false;
}
}
public static async Task<bool> GrabTheFile()
{
//some code here that will return true or return false
}
}
Continue reading...
class FirstClass
{
public static async Task Main(string[] args)
{
bool fileDownloaded = await GetFilesFromShareFile();
if (fileDownloaded == true)
{
method1();
method2();
method3();
method4();
method5();
}
else
{
return;
}
}
}
if (fileDownloaded)
{
method1();
method2();
method3();
method4();
method5();
}
class SecondClass
{
public static async Task<bool> GetFilesFromShareFile()
{
bool fileDownloaded = await GrabTheFile();
if (fileDownloaded = true)
{
return true;
}
else
{
return false;
}
}
public static async Task<bool> GrabTheFile()
{
//some code here that will return true or return false
}
}
Continue reading...