source: src/FinkiChattery/FinkiChattery.Commands/Questioning/AskQuestion/AskQuestionValidator.cs@ 95d80e4

dev
Last change on this file since 95d80e4 was 95d80e4, checked in by Стојков Марко <mst@…>, 3 years ago

Added unit of work pattern

  • Property mode set to 100644
File size: 590 bytes
Line 
1using FinkiChattery.Commands.Questioning.Validators;
2using FinkiChattery.Persistence.UnitOfWork;
3using FluentValidation;
4
5namespace FinkiChattery.Commands.Questioning
6{
7 public class AskQuestionValidator : AbstractValidator<AskQuestionCommand>
8 {
9 public AskQuestionValidator(IUnitOfWork unitOfWork)
10 {
11 RuleFor(x => x.Title).QuestionTitleValidate();
12 RuleFor(x => x.Text).QuestionTextValidate();
13 RuleFor(x => x.Categories).Cascade(CascadeMode.Stop).ListNotNull().SetValidator(new CategoriesUidsExist(unitOfWork));
14 }
15 }
16}
Note: See TracBrowser for help on using the repository browser.