예제 #1
0
        public async Task <IActionResult> GetFreeTermsByCarIdAsync(int id, DateTime?rentalDate, DateTime?returnDate)
        {
            if (!termService.DatesHaveValue(rentalDate, returnDate) || termService.DatesAreCorrect(rentalDate.Value, returnDate.Value))
            {
                var terms = await termService.GetFreeTermsByCarIdAsync(id, rentalDate, returnDate);

                return(Ok(terms));
            }
            return(BadRequest(resourcesManager.GetString("BadDateOrder")));
        }