Skip to content

Commit db85edd

Browse files
committed
use synchronized call and align coding style
1 parent 91e23d4 commit db85edd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/ai-services/computer-vision/how-to/identity-access-token.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,18 @@ public class LimitedAccessTokenPolicy : HttpPipelineSynchronousPolicy
125125
/// <param name="limitedAccessToken">LimitedAccessToken to bypass the limited access program, requires ISV sponsership.</param>
126126
public LimitedAccessTokenPolicy(string limitedAccessToken)
127127
{
128-
this.LimitedAccessToken = limitedAccessToken;
128+
_limitedAccessToken = limitedAccessToken;
129129
}
130130

131-
private readonly string LimitedAccessToken;
131+
private readonly string _limitedAccessToken;
132132

133133
/// <summary>
134134
/// Add the authentication header to each outgoing request
135135
/// </summary>
136136
/// <param name="message">The outgoing message</param>
137137
public override void OnSendingRequest(HttpMessage message)
138138
{
139-
message.Request.Headers.Add("LimitedAccessToken", $"Bearer {LimitedAccessToken}");
139+
message.Request.Headers.Add("LimitedAccessToken", $"Bearer {_limitedAccessToken}");
140140
}
141141
}
142142
```
@@ -154,7 +154,7 @@ static void Main(string[] args)
154154
// use Face client in an API call
155155
using (var stream = File.OpenRead("photo.jpg"))
156156
{
157-
var response = faceClient.DetectAsync(BinaryData.FromStream(stream), FaceDetectionModel.Detection03, FaceRecognitionModel.Recognition04, returnFaceId: true).Result;
157+
var response = faceClient.Detect(BinaryData.FromStream(stream), FaceDetectionModel.Detection03, FaceRecognitionModel.Recognition04, returnFaceId: true);
158158

159159
Console.WriteLine(JsonConvert.SerializeObject(response.Value));
160160
}

0 commit comments

Comments
 (0)