public async Task DatasetSample()
        {
            #region Snippet:CreateDatasetClient
            // Replace the string below with your actual endpoint url.
            string endpoint = "<my-endpoint-url>";
            /*@@*/ endpoint = TestEnvironment.EndpointUrl;
            DatasetClient client = new DatasetClient(endpoint: new Uri(endpoint), credential: new DefaultAzureCredential());
            #endregion

            #region Snippet:CreateDataset
            DatasetCreateOrUpdateDatasetOperation operation      = client.StartCreateOrUpdateDataset("MyDataset", new DatasetResource(new Dataset(new LinkedServiceReference(LinkedServiceReferenceType.LinkedServiceReference, TestEnvironment.WorkspaceName + "-WorkspaceDefaultStorage"))));
            Response <DatasetResource>            createdDataset = await operation.WaitForCompletionAsync();

            #endregion

            #region Snippet:RetrieveDataset
            DatasetResource retrievedDataset = client.GetDataset("MyDataset");
            #endregion

            #region Snippet:ListDatasets
            Pageable <DatasetResource> datasets = client.GetDatasetsByWorkspace();
            foreach (DatasetResource dataset in datasets)
            {
                System.Console.WriteLine(dataset.Name);
            }
            #endregion

            #region Snippet:DeleteDataset
            client.StartDeleteDataset("MyDataset");
            #endregion
        }
 public DatasetResource GetDataset(string datasetName)
 {
     return(_datasetClient.GetDataset(datasetName));
 }
示例#3
0
 public void RetrieveDataset()
 {
     #region Snippet:RetrieveDataset
     DatasetResource dataset = DatasetClient.GetDataset("MyDataset");
     #endregion
 }