Udostępnij przez


Entity.MoveEntitiesToCollectionAsync Method

Definition

Overloads

Name Description
MoveEntitiesToCollectionAsync(String, MoveEntitiesConfig, CancellationToken)

Move existing entities to the target collection.

MoveEntitiesToCollectionAsync(String, RequestContent, RequestContext)

[Protocol Method] Move existing entities to the target collection.

MoveEntitiesToCollectionAsync(String, MoveEntitiesConfig, CancellationToken)

Source:
Entity.cs

Move existing entities to the target collection.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.EntityMutationResult>> MoveEntitiesToCollectionAsync(string collectionId, Azure.Analytics.Purview.DataMap.MoveEntitiesConfig body, System.Threading.CancellationToken cancellationToken = default);
abstract member MoveEntitiesToCollectionAsync : string * Azure.Analytics.Purview.DataMap.MoveEntitiesConfig * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.EntityMutationResult>>
override this.MoveEntitiesToCollectionAsync : string * Azure.Analytics.Purview.DataMap.MoveEntitiesConfig * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.EntityMutationResult>>
Public Overridable Function MoveEntitiesToCollectionAsync (collectionId As String, body As MoveEntitiesConfig, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of EntityMutationResult))

Parameters

collectionId
String

The collection where entities will be moved to.

body
MoveEntitiesConfig

Body parameter.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

collectionId or body is null.

Examples

This sample shows how to call MoveEntitiesToCollectionAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient(apiVersion: "2023-09-01");

MoveEntitiesConfig body = new MoveEntitiesConfig
{
    EntityGuids = { "321493e3-3fb7-4b3e-9df7-3b69154174c2", "b2f9c306-cf65-4bb0-878e-cfaafde156b1" },
};
Response<EntityMutationResult> response = await client.MoveEntitiesToCollectionAsync("ExampleNewCollection", body);

Applies to

MoveEntitiesToCollectionAsync(String, RequestContent, RequestContext)

Source:
Entity.cs

[Protocol Method] Move existing entities to the target collection.

public virtual System.Threading.Tasks.Task<Azure.Response> MoveEntitiesToCollectionAsync(string collectionId, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member MoveEntitiesToCollectionAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.MoveEntitiesToCollectionAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function MoveEntitiesToCollectionAsync (collectionId As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

collectionId
String

The collection where entities will be moved to.

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

collectionId or content is null.

Service returned a non-success status code.

Examples

This sample shows how to call MoveEntitiesToCollectionAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient(apiVersion: "2023-09-01");

using RequestContent content = RequestContent.Create(new
{
    entityGuids = new object[]
    {
        "321493e3-3fb7-4b3e-9df7-3b69154174c2",
        "b2f9c306-cf65-4bb0-878e-cfaafde156b1"
    },
});
Response response = await client.MoveEntitiesToCollectionAsync("ExampleNewCollection", content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

Applies to