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
ownerUserIdThe user the file belongs to.
mediaTypestringThe media type the file is served under.
contentReadOnlyMemory<byte>The octets, stored as they were supplied.
cancellationTokenCancellationTokenCancels 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
ownernames nobody,mediaTypeis blank, orcontentis empty.