Table of Contents

Method WriteAsync

Namespace
MailFathom.Application.StoredFiles
Assembly
MailFathom.Application.dll

WriteAsync(UserId, string, ReadOnlyMemory<byte>, CancellationToken)

Writes one file for one user, placing its octets before the row that records it.

Task<StoredFileId?> WriteAsync(UserId owner, string mediaType, ReadOnlyMemory<byte> content, CancellationToken cancellationToken)

Parameters

owner UserId

The user the file belongs to.

mediaType string

The media type the file is served under.

content ReadOnlyMemory<byte>

The octets, stored as they were supplied.

cancellationToken CancellationToken

Cancels the placement and the commit.

Returns

Task<StoredFileId?>

The identifier minted for the file, or null when this deployment holds no such user.

Exceptions

ArgumentException

Thrown when owner names nobody, mediaType is blank, or content is empty.