private bool CheckDatasetExists(string resourceGroupName, string dataFactoryName, string datasetName)
{
// ToDo: implement HEAD to check if the dataset exists
try
{
PSDataset dataset = this.GetDataset(resourceGroupName, dataFactoryName, datasetName);
return true;
}
catch (CloudException e)
{
//Get throws Exception message with NotFound Status
if (e.Response.StatusCode == HttpStatusCode.NotFound)
{
return false;
}
else
{
throw;
}
}
}
}