public BookCommandValidator(IBookQueryRepository bookRepository) { this.RuleFor(c => c.Title) .MinimumLength(MinTitleLength) .MaximumLength(MaxTitleLength) .NotEmpty(); this.RuleFor(c => c.Publisher) .MinimumLength(MinNameLength) .MaximumLength(MaxNameLength) .NotEmpty(); this.RuleFor(c => c.Price) .InclusiveBetween(Zero, decimal.MaxValue); this.RuleFor(c => c.NumberOfPages) .InclusiveBetween(MinNumberOfPages, MaxNumberOfPages); this.RuleFor(c => c.CoverType) .Must(Enumeration.HasValue <CoverType>) .WithMessage("'Cover Type' is not valid."); this.RuleFor(c => c.CategoryType) .Must(Enumeration.HasValue <CategoryType>) .WithMessage("'Category Type' is not valid."); }
public BookDetailsQueryHandler( IBookQueryRepository bookRepository, IAuthorQueryRepository authorRepository) { this.bookRepository = bookRepository; this.authorRepository = authorRepository; }
public CreateBookCommandValidator(IBookQueryRepository bookRepository) => this.Include(new BookCommandValidator <CreateBookCommand>(bookRepository));
public GetBookAuthorsQueryHandler(IBookQueryRepository bookRepository) => this.bookRepository = bookRepository;
public SearchBooksQueryHandler(IBookQueryRepository bookRepository) : base(bookRepository) { }
protected BooksQueryHandler(IBookQueryRepository bookRepository) => this.bookRepository = bookRepository;