Show / Hide Table of Contents

Method AddAttachmentAsync

AddAttachmentAsync(string, string, ReadOnlySpan<byte>)

Asynchronously adds a new attachment to this feature.

Declaration
public Task<Attachment> AddAttachmentAsync(string name, string contentType, ReadOnlySpan<byte> data)
Parameters
Type Name Description
string name

The name for the attachment.

string contentType

The content type for the attachment.

ReadOnlySpan<byte> data

The data for the attachment.

Returns
Type Description
Task<Attachment>

A Task that represents the asynchronous add attachment operation. The value of the task result is an Attachment object.

Applies to

Platforms and versions
TargetVersions
.NET200.3 - 300.0
.NET Windows200.3 - 300.0
.NET Android200.3 - 300.0
.NET iOS200.3 - 300.0

AddAttachmentAsync(string, string, byte[])

Asynchronously adds a new attachment to this feature.

Declaration
public Task<Attachment> AddAttachmentAsync(string name, string contentType, byte[] data)
Parameters
Type Name Description
string name

The name for the attachment.

string contentType

The content type for the attachment.

byte[] data

The data for the attachment.

Returns
Type Description
Task<Attachment>

A task that represents the asynchronous add attachment operation. The value of the task result is an Attachment object.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.8
.NET100.13 - 300.0
.NET Windows100.13 - 300.0
.NET Android200.0 - 300.0
.NET iOS200.0 - 300.0
.NET Framework100.0 - 200.8
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.8

AddAttachmentAsync(string, string, ReadOnlySpan<byte>, string)

Asynchronously adds a new attachment, with keywords, to this feature.

Declaration
public Task<Attachment> AddAttachmentAsync(string name, string contentType, ReadOnlySpan<byte> data, string keywords)
Parameters
Type Name Description
string name

The name for the attachment.

string contentType

The content type for the attachment.

ReadOnlySpan<byte> data

The data for the attachment.

string keywords

The keywords for the attachment.

Returns
Type Description
Task<Attachment>

A Task that represents the asynchronous add attachment operation. The value of the task result is an Attachment object.

Remarks

Throws an error if the feature layer doesn't support the attachment keywords.

Exceptions
Type Condition
ArgumentException

Thrown if the feature table does not support keywords.

See Also
FeatureServiceSessionType

Applies to

Platforms and versions
TargetVersions
.NET300
.NET Windows300
.NET Android300
.NET iOS300

AddAttachmentAsync(string, string, byte[], string)

Asynchronously adds a new attachment, with keywords, to this feature.

Declaration
public Task<Attachment> AddAttachmentAsync(string name, string contentType, byte[] data, string keywords)
Parameters
Type Name Description
string name

The name for the attachment.

string contentType

The content type for the attachment.

byte[] data

The data for the attachment.

string keywords

The keywords for the attachment.

Returns
Type Description
Task<Attachment>

A Task that represents the asynchronous add attachment operation. The value of the task result is an Attachment object.

Remarks

Throws an error if the feature layer doesn't support the attachment keywords.

Exceptions
Type Condition
ArgumentException

Thrown if the feature table does not support keywords.

ArgumentNullException

Thrown if data is null.

See Also
FeatureServiceSessionType

Applies to

Platforms and versions
TargetVersions
.NET300
.NET Windows300
.NET Android300
.NET iOS300

AddAttachmentAsync(string, string, string, string)

Asynchronously adds a new attachment, with keywords, to this feature from the specified file.

Declaration
public Task<Attachment> AddAttachmentAsync(string name, string contentType, string filePath, string keywords)
Parameters
Type Name Description
string name

The name for the Attachment.

string contentType

The content type for the attachment.

string filePath

The file path that will be used for the attachment's content

string keywords

The keywords for the attachment.

Returns
Type Description
Task<Attachment>

A Task that represents the asynchronous add attachment operation. The value of the task result is an Attachment object.

Exceptions
Type Condition
InvalidOperationException

Thrown if the feature layer doesn't support attachments.

FileNotFoundException

Thrown if the file specified by filePath does not exist.

ArgumentException

Thrown if the feature table does not support keywords.

See Also
FeatureServiceSessionType

Applies to

Platforms and versions
TargetVersions
.NET300
.NET Windows300
.NET Android300
.NET iOS300

AddAttachmentAsync(string, string, string)

Asynchronously adds a new attachment to this feature from the specified file.

Declaration
public Task<Attachment> AddAttachmentAsync(string name, string contentType, string filePath)
Parameters
Type Name Description
string name

The name for the Attachment.

string contentType

The content type for the attachment.

string filePath

The file path that will be used for the attachment's content

Returns
Type Description
Task<Attachment>

A Task that represents the asynchronous add attachment operation. The value of the task result is an Attachment object.

Exceptions
Type Condition
FileNotFoundException

Thrown if the file specified by filePath does not exist.

InvalidOperationException

Thrown if the feature layer doesn't support attachments.

See Also
FeatureServiceSessionType

Applies to

Platforms and versions
TargetVersions
.NET300
.NET Windows300
.NET Android300
.NET iOS300
In this article
Provide feedback
Back to top Copyright © 2025 Esri.