public EditAuthorCommandHandler( ICurrentUser currentUser, IAuthorDomainRepository authorRepository) { this.currentUser = currentUser; this.authorRepository = authorRepository; }
public LoginUserCommandHandler( IIdentity identity, IAuthorDomainRepository authorRepository) { this.identity = identity; this.authorRepository = authorRepository; }
public EditBookCommandHandler( ICurrentUser currentUser, IBookDomainRepository bookRepository, IAuthorDomainRepository authorRepository) { this.currentUser = currentUser; this.bookRepository = bookRepository; this.authorRepository = authorRepository; }
public ChangeAvailabilityCommandHandler( ICurrentUser currentUser, IBookDomainRepository bookRepository, IAuthorDomainRepository authorRepository) { this.currentUser = currentUser; this.bookRepository = bookRepository; this.authorRepository = authorRepository; }
public CreateAuthorCommandHandler( ICurrentUser currentUser, IAuthorDomainRepository authorRepository, IAuthorFactory authorFactory) { this.currentUser = currentUser; this.authorRepository = authorRepository; this.authorFactory = authorFactory; }
public static async Task <Result> AuthorHasBook( this ICurrentUser currentUser, IAuthorDomainRepository authorRepository, int bookId, CancellationToken cancellationToken) { var authorId = await authorRepository.GetAuthorId( currentUser.UserId, cancellationToken); var authorHasBook = await authorRepository.HasBook( authorId, bookId, cancellationToken); return(authorHasBook ? Result.Success : "You cannot edit this book."); }