public CountryHandler( BookShelfContext bookShelfContext, IValidator <CreateCountry> createCountryValidator, IValidator <UpdateCountry> updateCountryValidator ) { _bookShelfContext = bookShelfContext; _createCountryValidator = createCountryValidator; _updateCountryValidator = updateCountryValidator; }
public CreateCountryValidator(BookShelfContext bookShelfContext) { _bookShelfContext = bookShelfContext; RuleFor(request => request.Country.Name) .Cascade(CascadeMode.Stop) .NotEmpty() .WithErrorCode("name") .WithMessage(Validation.CountryNameRequired) .MustAsync(CountryNameMustBeUnique) .WithErrorCode("name") .WithMessage(Validation.CountryNameTaken); }
public ProductInfoHandler(BookShelfContext context) { _context = context; }
public BookssController(BookShelfContext context) { _context = context; }