public ClientsController(IClientOrderService clientOrderService, IMapper mapper) { this.clientOrderService = clientOrderService; this.mapper = mapper; }
public ClientOrderRepository(IClientOrderService clientOrderService) { _service = clientOrderService.Save(this); }
public CartController(IClientCartService clientCartService, IClientOrderService clientOrderService) { this._clientCartService = clientCartService; this._clientOrderService = clientOrderService; }
public ManageController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, IClientOrderService clientOrderService) { _userManager = userManager; _signInManager = signInManager; this._clientOrderService = clientOrderService; }
public ClientOrderRepository(IClientOrderService clientOrderService) { _service = clientOrderService; }
public IActionResult GetFreeRooms([FromQuery] HotelRoomSeachFilterModel filter, [FromServices] IClientOrderService clientOrderService) { if (filter is null) { return(BadRequest()); } if (filter.CheckOutDate != null && filter.CheckInDate >= filter.CheckOutDate) { ModelState.AddModelError("", "CheckInDate can't be more or equal than CheckOutDate"); } if (filter.CheckInDate.Date < DateTime.Today) { ModelState.AddModelError("", "CheckInDate can't be less than current date"); } if (ModelState.IsValid) { IEnumerable <FreeHotelRoomDTO> rooms = clientOrderService.SearchFreeRooms(mapper.Map <HotelRoomSeachFilterDTO>(filter)); return(new ObjectResult(mapper.Map <IEnumerable <FreeHotelRoomDTO>, IEnumerable <FreeHotelRoomModel> >(rooms))); } return(BadRequest()); }