Edit

Share via


GraphExtensions.SetFileAsync<T> Method

Definition

Updates or create a new file on the remote with the provided content.

public static System.Threading.Tasks.Task<Microsoft.Graph.DriveItem> SetFileAsync<T>(this Microsoft.Graph.GraphServiceClient graph, string userId, string itemPath, T fileContents, Microsoft.Toolkit.Helpers.IObjectSerializer serializer);
static member SetFileAsync : Microsoft.Graph.GraphServiceClient * string * string * 'T * Microsoft.Toolkit.Helpers.IObjectSerializer -> System.Threading.Tasks.Task<Microsoft.Graph.DriveItem>
<Extension()>
Public Function SetFileAsync(Of T) (graph As GraphServiceClient, userId As String, itemPath As String, fileContents As T, serializer As IObjectSerializer) As Task(Of DriveItem)

Type Parameters

T

The type of object to save.

Parameters

graph
Microsoft.Graph.GraphServiceClient

Instance of the Microsoft.Graph.GraphServiceClient.

userId
String

The id of the target Graph user.

itemPath
String

The path of the target item.

fileContents
T

The contents to put in the file.

serializer
IObjectSerializer

A serializer for converting stored values.

Returns

Task<Microsoft.Graph.DriveItem>

A Task representing the asynchronous operation.

Applies to