Class ContactBookReader
- Namespace
- MailFathom.Application.Contacts
- Assembly
- MailFathom.Application.dll
Reads the 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 MailContactsRead, 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.
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, 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.