pubic partial class FaceServiceClient
{
public FaceServiceClient(Uri endpoint, AzureKeyCredential credential, FaceServiceClientOptions options)
{
Argument.AssertNotNull(endpoint, nameof(endpoint));
Argument.AssertNotNull(credential, nameof(credential));
options ??= new AnomalyDetectorClientOptions();
ClientDiagnostics = new ClientDiagnostics(options, true);
_keyCredential = credential;
_pipeline = HttpPipelineBuilder.Build(options, Array.Empty<HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier());
_endpoint = endpoint;
_apiVersion = options.Version;
}
FaceListClient GetFaceListClient()
FaceLargeListClient GetLargeFaceListClient()
PersonGroupClient GetPersonGroupClient()
PersonLargeGroupClient GetLargePersonGroupClient()
}
public partial class FaceListClient
{
//added public constructor
public FaceListClient(Uri endpoint, AzureKeyCredential credential, FaceServiceClientOptions options)
{
Argument.AssertNotNull(endpoint, nameof(endpoint));
Argument.AssertNotNull(credential, nameof(credential));
options ??= new AnomalyDetectorClientOptions();
ClientDiagnostics = new ClientDiagnostics(options, true);
_keyCredential = credential;
_pipeline = HttpPipelineBuilder.Build(options, Array.Empty<HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier());
_endpoint = endpoint;
_apiVersion = options.Version;
}
// interal construtor for Get accessor
internal FaceServiceClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, Uri endpoint, string apiVersion)
{
ClientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
_keyCredential = keyCredential;
_endpoint = endpoint;
_apiVersion = apiVersion;
}
}
Current .NET SDK support two kinds of Client:
There is a third kind of client: a subclient with public constructor
Rule: When a subclient with public constructor:
example as following: