Microsoft.Azure.Commands.DataFactories.DataFactoryClient.CheckDataFactoryExists C# (CSharp) Method

CheckDataFactoryExists() private method

private CheckDataFactoryExists ( string resourceGroupName, string dataFactoryName, PSDataFactory &dataFactory ) : bool
resourceGroupName string
dataFactoryName string
dataFactory Microsoft.Azure.Commands.DataFactories.Models.PSDataFactory
return bool
        private bool CheckDataFactoryExists(string resourceGroupName, string dataFactoryName, out PSDataFactory dataFactory)
        {
            dataFactory = null;
            // ToDo: use HEAD to check if a resource exists or not
            try
            {
                dataFactory = GetDataFactory(resourceGroupName, dataFactoryName);

                return true;
            }
            catch (CloudException e)
            {
                //Get throws NotFound exception if data factory not exists
                if (e.Response.StatusCode == HttpStatusCode.NotFound)
                {
                    return false;
                }

                throw;
            }
        }