Table of Contents

Method AskAsync

Namespace
MailFathom.Application.Agent.Conversations
Assembly
MailFathom.Application.dll

AskAsync(AgentConversationId, UserId, AgentMessageWritten, AgentMessageId, DateTimeOffset, CancellationToken)

Writes a person's question and opens the answer to it, starting the conversation where it has not been started.

Task<AgentMessagePosting> AskAsync(AgentConversationId id, UserId user, AgentMessageWritten question, AgentMessageId answer, DateTimeOffset now, CancellationToken cancellationToken)

Parameters

id AgentConversationId

The conversation, which the client named and which is started here when nothing stands under it yet.

user UserId

The person asking, whose conversation it is or becomes.

question AgentMessageWritten

The question, written by the person.

answer AgentMessageId

The answer the question opens, which is the run composing it.

now DateTimeOffset

The instant the question was asked, in UTC.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<AgentMessagePosting>

What became of the question, and the answer it opened.

Remarks

The question and the opening of its answer are written together or not at all. A question left in the record with no answer opened behind it would read as an instruction to whatever answer came next, so the conversation's row is held for the whole of it and a question asked while an answer is still being composed writes nothing.

A question already in the conversation is not written twice. Its identifier is the client's, so a second post under it is the first one retried, and what comes back is what the first one wrote — the same answer and the same place — rather than a refusal the client could not tell from a real one.

A question that would start a conversation for a person already holding MaximumConversations writes nothing and says TooManyConversations; a question into one they already hold is unaffected.

Exceptions

ArgumentNullException

Thrown when question is null.

ArgumentException

Thrown when question is not the person's own.