Show / Hide Table of Contents

Interface IAttachmentContainer

A container for attachment files, which may or may not have been downloaded into local memory or storage.

Inherited Members
IEnumerable<AttachmentInfo>.GetEnumerator()
Namespace: CrashCABN.Metadata
Assembly: CrashCABN.Metadata.Abstractions.dll
Syntax
public interface IAttachmentContainer : IEnumerable<AttachmentInfo>, IEnumerable

Methods

View Source

Load(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.

View Source

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.

View Source

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.

View Source

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.

  • View Source
In this article
Back to top Generated by DocFX