public async Task <ActionResult> Book(int roomId, DateTime fromDate, DateTime toDate) { var daysCount = toDate - fromDate; var reservation = new Reservation { StartDate = fromDate, EndDate = toDate, UserId = User.Identity.GetUserId(), DayCount = daysCount.Days, RoomId = roomId }; var result = await reservationRepository.Book(reservation); if (result == null) { return(Content("Something went wrong: the room is not available at this date")); } return(Content("Reservation is Successfull")); }