Interface IAttachmentContainer
A container for attachment files, which may or may not have been downloaded into local memory or storage.
Inherited Members
Namespace: CrashCABN.Metadata
Assembly: CrashCABN.Metadata.Abstractions.dll
Syntax
public interface IAttachmentContainer : IEnumerable<AttachmentInfo>, IEnumerable
Methods
View SourceLoad(string)
Loads an attachment from the IAttachmentContainer.
Declaration
ValueTask<object> Load(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the attachment to load. |
Returns
Type | Description |
---|---|
ValueTask<object> | A task representing the attachment contents. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | Thrown if the attachment is missing. |
Load<T>(string)
Loads a typed attachment from the IAttachmentContainer.
Declaration
ValueTask<T> Load<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the attachment to load. |
Returns
Type | Description |
---|---|
ValueTask<T> | A task representing the attachment contents. |
Type Parameters
Name | Description |
---|---|
T | The type of the attachment to load. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | Thrown if the attachment is missing. |
InvalidCastException | Thrown if the attachment is not of the given type. |
TryGetInfo(string)
Gets the attachment info.
Declaration
AttachmentInfo? TryGetInfo(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the attachment. |
Returns
Type | Description |
---|---|
AttachmentInfo | The info, if it exists. |
TryLoad(string)
Loads an attachment from the IAttachmentContainer.
Declaration
ValueTask<object?> TryLoad(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the attachment to load. |
Returns
Type | Description |
---|---|
ValueTask<object> | A task representing the attachment contents, or null if the attachment was missing. |