Entity.AddOrUpdateBusinessMetadataAttributesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AddOrUpdateBusinessMetadataAttributesAsync(String, String, RequestContent, RequestContext) |
[Protocol Method] Add or update business metadata attributes.
|
| AddOrUpdateBusinessMetadataAttributesAsync(String, String, IDictionary<String,BinaryData>, CancellationToken) |
Add or update business metadata attributes. |
AddOrUpdateBusinessMetadataAttributesAsync(String, String, RequestContent, RequestContext)
- Source:
- Entity.cs
[Protocol Method] Add or update business metadata attributes.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler AddOrUpdateBusinessMetadataAttributesAsync(String, String, IDictionary<String,BinaryData>, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> AddOrUpdateBusinessMetadataAttributesAsync(string guid, string businessMetadataName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AddOrUpdateBusinessMetadataAttributesAsync : string * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AddOrUpdateBusinessMetadataAttributesAsync : string * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AddOrUpdateBusinessMetadataAttributesAsync (guid As String, businessMetadataName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- guid
- String
The globally unique identifier of the entity.
- businessMetadataName
- String
BusinessMetadata name.
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
guid, businessMetadataName or content is null.
guid or businessMetadataName is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Examples
This sample shows how to call AddOrUpdateBusinessMetadataAttributesAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
using RequestContent content = RequestContent.Create(new
{
bizAttr1 = "bizAttr1",
});
Response response = await client.AddOrUpdateBusinessMetadataAttributesAsync("02c373fe-2823-4be3-97fa-55180a9faa06", "myBizMetaData1", content);
Console.WriteLine(response.Status);
Applies to
AddOrUpdateBusinessMetadataAttributesAsync(String, String, IDictionary<String,BinaryData>, CancellationToken)
- Source:
- Entity.cs
Add or update business metadata attributes.
public virtual System.Threading.Tasks.Task<Azure.Response> AddOrUpdateBusinessMetadataAttributesAsync(string guid, string businessMetadataName, System.Collections.Generic.IDictionary<string,BinaryData> body, System.Threading.CancellationToken cancellationToken = default);
abstract member AddOrUpdateBusinessMetadataAttributesAsync : string * string * System.Collections.Generic.IDictionary<string, BinaryData> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.AddOrUpdateBusinessMetadataAttributesAsync : string * string * System.Collections.Generic.IDictionary<string, BinaryData> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AddOrUpdateBusinessMetadataAttributesAsync (guid As String, businessMetadataName As String, body As IDictionary(Of String, BinaryData), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)
Parameters
- guid
- String
The globally unique identifier of the entity.
- businessMetadataName
- String
BusinessMetadata name.
- body
- IDictionary<String,BinaryData>
Business metadata attribute payload.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
guid, businessMetadataName or body is null.
guid or businessMetadataName is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call AddOrUpdateBusinessMetadataAttributesAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
Response response = await client.AddOrUpdateBusinessMetadataAttributesAsync("02c373fe-2823-4be3-97fa-55180a9faa06", "myBizMetaData1", new Dictionary<string, BinaryData>
{
["bizAttr1"] = BinaryData.FromObjectAsJson("bizAttr1")
});