Class ContactBookReader
- Namespace
- MailFathom.Application.Contacts
- Assembly
- MailFathom.Application.dll
Reads the caller's own contact book, for a caller that was granted reading it.
public sealed class ContactBookReader
- Inheritance
-
ContactBookReader
- Inherited Members
Remarks
The book itself is ContactBook and the rows are IContactDirectory's; what this use case adds is the two things a caller-facing read owes and neither of those does — that the caller holds ContactsRead, and that every bound on a page is applied before the store is reached. The permission is asked for here rather than only at the transport, so an entrypoint added later cannot reach the book by arriving another way.
Which books are read is ContactBookOwnership's answer rather than an argument of the request, so a caller reads the book of the user they were admitted to act for beside the collected book of each mail account assigned to them, and no request of theirs can name another. A contact outside that scope is answered as one these books do not hold.
There is no unbounded read. A caller naming no page size is served the book's default rather than everything, and one asking for more than the ceiling is refused rather than quietly served the ceiling — which is what stops a request from deciding how much of a person's correspondents leaves the database at once.
Nothing here logs. A name, an address, and a note are personal data about a third party, and a page is a great many of them at once.
Constructors
- ContactBookReader(IContactDirectory, ContactBookOwnership, AccessAuthorization)
Initializes the use case over the directory it reads and the authorization it asks first.
Methods
- FindAsync(ContactId, CancellationToken)
Reads one contact by the identity the book gave it.
- FindByAddressAsync(EmailAddress, CancellationToken)
Reads the person who uses one address.
- ReadPageAsync(ContactPageRequest, CancellationToken)
Serves one bounded page of the book.