private bool CheckLinkedServiceExists(string resourceGroupName, string dataFactoryName, string linkedServiceName)
{
// ToDo: implement HEAD to check if the linked service exists
try
{
PSLinkedService linkedService = GetLinkedService(resourceGroupName, dataFactoryName, linkedServiceName);
return true;
}
catch (CloudException e)
{
//Get throws Exception message with NotFound Status
if (e.Response.StatusCode == HttpStatusCode.NotFound)
{
return false;
}
else
{
throw;
}
}
}
}