public async Task <Attachment> UploadAsync(string name, string contentType, Stream contents) { Guid id = Guid.NewGuid(); var attachment = await Attachment.CopyFromAsync(id, name, contentType, contents); _attachments.GetOrAdd(id, attachment); return(attachment); }