public PresentationValidator(IPresentationsService service) { CascadeMode = CascadeMode.StopOnFirstFailure; RuleFor(_ => _.Title).NotEmpty().MinimumLength(5).WithMessage("Title must be more than 5 characters"); RuleSet("UpdatePresentation", () => { RuleFor(_ => _.Id).Must(id => !string.IsNullOrEmpty(id)).WithMessage("Id must not be Empty or null"); }); }
public void OneTimeInitialize() { var mapperConfig = new MapperConfiguration(cfg => { cfg.CreateMap <PresentationAdd_DTO, PresentationDB>(); cfg.CreateMap <Presentation, PresentationDB>() .ReverseMap(); }); _mapper = new Mapper(mapperConfig); _mockUnitRepo = new Mock <IUnitOfWorkRepository>(); _service = new PresentationsService(_mockUnitRepo.Object, _mapper); }
public PresentationsController(IPresentationsService presentationBase, IBus bus) { _presentationsBase = presentationBase; _bus = bus; }