示例#1
0
        public CreateRoomDetailCommandValidator(IRoomDetailsRepositoryAsync roomDetailRepository)
        {
            this.roomDetailRepository = roomDetailRepository;

            RuleFor(p => p.RoomNo)
            .NotEmpty().WithMessage("{RoomNo} is required.")
            .NotNull()
            .MaximumLength(50).WithMessage("{RoomNo} must not exceed 5 characters.")
            .MustAsync(IsRoomNoUniqueAsync).WithMessage("{RoomNo} already exists.");

            RuleFor(p => p.NoOfBed)
            //.NotEmpty().WithMessage("{PropertyName} is required.")
            .NotNull().WithMessage("{NoOfBed} is required.");
            //.MaximumLength(50).WithMessage("{PropertyName} must not exceed 50 characters.");
        }
 public UpdateRoomDetailCommandHandler(IRoomDetailsRepositoryAsync roomDetailRepository)
 {
     _roomDetailRepository = roomDetailRepository;
 }
示例#3
0
 public DeleteRoomDetailByIdCommandHandler(IRoomDetailsRepositoryAsync roomDetailRepository)
 {
     _roomDetailRepository = roomDetailRepository;
 }
示例#4
0
 public GetRoomDetailByIdQueryHandler(IRoomDetailsRepositoryAsync roomDetailRepository)
 {
     _roomDetailRepository = roomDetailRepository;
 }
 public GetAllRoomDetailsQueryHandler(IRoomDetailsRepositoryAsync roomDetailsRepository, IMapper mapper)
 {
     _roomDetailsRepository = roomDetailsRepository;
     _mapper = mapper;
 }
示例#6
0
 public CreateRoomDetailCommandHandler(IRoomDetailsRepositoryAsync productRepository, IMapper mapper)
 {
     _productRepository = productRepository;
     _mapper            = mapper;
 }