public static bool DeleteDatasets(string startWithSearchText)
        {
            try
            {
                string nextLink = string.Empty;

                DatasetListResponse respListDatasets = (DatasetListResponse)client.Datasets.List(resourceGroupName, dataFactoryName);

                do
                {
                    nextLink = respListDatasets.NextLink;

                    foreach (var ds in respListDatasets.Datasets)
                    {
                        DeleteDataset(ds.Name, startWithSearchText);
                    }

                    respListDatasets = client.Datasets.ListNext(nextLink);
                } while (!String.IsNullOrEmpty(nextLink));


                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("unable to delete the data set: " + ex.Message);
            }
            return(false);
        }
        public async Task <Response <DatasetListResponse> > GetDatasetsByWorkspaceAsync(CancellationToken cancellationToken = default)
        {
            using var message = CreateGetDatasetsByWorkspaceRequest();
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                DatasetListResponse value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                value = DatasetListResponse.DeserializeDatasetListResponse(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }