Struct ClientConnection
Represents the connection options for a client.
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.IsReadOnly]
[System.Runtime.CompilerServices.Nullable(0)]
[System.Runtime.CompilerServices.NullableContext(1)]
public struct ClientConnection
Constructors
ClientConnection(String, String)
Initializes a new instance of the ClientConnection struct with a with no authentication.
Declaration
public ClientConnection (string id, string locator);
Parameters
|
System.String
id
The identifier for the connection. |
|
System.String
locator
The endpoint or resource identifier. |
ClientConnection(String, String, Object, CredentialKind)
Initializes a new instance of the ClientConnection struct with a token credential.
Declaration
public ClientConnection (string id, string locator, object credential, System.ClientModel.Primitives.CredentialKind credentialKind);
Parameters
|
System.String
id
The identifier for the connection. |
|
System.String
locator
The endpoint or resource identifier. |
|
System.Object
credential
The client credential. |
|
CredentialKind
credentialKind
The kind of connection used by the client. |
Properties
Credential
Gets the credential.
Declaration
[System.Runtime.CompilerServices.Nullable(2)]
[get: System.Runtime.CompilerServices.NullableContext(2)]
public object Credential { get; }
Property Value
|
System.Object
|
CredentialKind
Gets the kind of connection used by the client.
Declaration
public System.ClientModel.Primitives.CredentialKind CredentialKind { get; }
Property Value
|
CredentialKind
|
Id
Gets the connection identifier.
Declaration
public string Id { get; }
Property Value
|
System.String
|
Locator
This is either URI, name, or something similar.
Declaration
public string Locator { get; }
Property Value
|
System.String
|
Methods
ToString()
Returns a string representation of the connection.
Declaration
public override string ToString ();
Returns
|
System.String
A string in the format 'Id => Locator'. |
TryGetLocatorAsUri(Uri)
Tries to convert the connection locator to a URI.
Declaration
[System.Runtime.CompilerServices.NullableContext(2)]
public bool TryGetLocatorAsUri (out Uri uri);
Parameters
|
System.Uri
uri
When this method returns, contains the URI representation of the connection if the conversion succeeded; otherwise, null. |
Returns
|
System.Boolean
|