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
| Target | Versions |
|---|---|
| .NET | 200.3 - 300.0 |
| .NET Windows | 200.3 - 300.0 |
| .NET Android | 200.3 - 300.0 |
| .NET iOS | 200.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
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.3 - 200.8 |
| .NET | 100.13 - 300.0 |
| .NET Windows | 100.13 - 300.0 |
| .NET Android | 200.0 - 300.0 |
| .NET iOS | 200.0 - 300.0 |
| .NET Framework | 100.0 - 200.8 |
| Xamarin.Android | 100.0 - 100.15 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.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
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET | 300 |
| .NET Windows | 300 |
| .NET Android | 300 |
| .NET iOS | 300 |
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 |
See Also
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET | 300 |
| .NET Windows | 300 |
| .NET Android | 300 |
| .NET iOS | 300 |
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 |
| ArgumentException | Thrown if the feature table does not support keywords. |
See Also
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET | 300 |
| .NET Windows | 300 |
| .NET Android | 300 |
| .NET iOS | 300 |
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 |
| InvalidOperationException | Thrown if the feature layer doesn't support attachments. |
See Also
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET | 300 |
| .NET Windows | 300 |
| .NET Android | 300 |
| .NET iOS | 300 |