Skip to content

Commit 009c1b3

Browse files
committed
update code to latest SDK
1 parent 64ce0b7 commit 009c1b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/cognitive-services/Anomaly-Detector/includes/quickstarts/anomaly-detector-client-library-csharp.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Build succeeded.
5757
Within the application directory, install the Anomaly Detector client library for .NET with the following command:
5858

5959
```dotnetcli
60-
dotnet add package Azure.AI.AnomalyDetector --version 3.0.0-preview.5
60+
dotnet add package Azure.AI.AnomalyDetector --prerelease
6161
```
6262

6363
## Retrieve key and endpoint
@@ -130,7 +130,6 @@ using System.Linq;
130130
using System.Text;
131131
using Azure;
132132
using Azure.AI.AnomalyDetector;
133-
using Azure.AI.AnomalyDetector.Models;
134133
using static System.Environment;
135134

136135
namespace anomaly_detector_quickstart
@@ -158,13 +157,13 @@ namespace anomaly_detector_quickstart
158157
.Where(e => e.Length == 2)
159158
.Select(e => new TimeSeriesPoint(float.Parse(e[1])) { Timestamp = DateTime.Parse(e[0]) }).ToList();
160159

161-
//create request
162-
DetectRequest request = new DetectRequest(list)
160+
//create request
161+
UnivariateDetectionOptions request = new UnivariateDetectionOptions(list)
163162
{
164163
Granularity = TimeGranularity.Daily
165164
};
166165

167-
EntireDetectResponse result = client.DetectEntireSeries(request);
166+
UnivariateEntireDetectionResult result = client.DetectUnivariateEntireSeries(request);
168167

169168
bool hasAnomaly = false;
170169
for (int i = 0; i < request.Series.Count; ++i)
@@ -183,6 +182,7 @@ namespace anomaly_detector_quickstart
183182
}
184183
}
185184

185+
186186
```
187187

188188
> [!IMPORTANT]

0 commit comments

Comments
 (0)