Example #1
0
        public ActionResult <BookingOut> Book([FromBody] BookingInput input)
        {
            //  BookingInput booData = input;

            var apartT = _dataService.GetAllAppartments().Where(x => x.Id.ToString() == input.ApartmentId).First();

            BookingOut rzlt = new BookingOut();

            rzlt.ReservationNumber = Guid.NewGuid().ToString();

            BookRecords newBook = new BookRecords();

            newBook.FName             = input.Fname;
            newBook.lName             = input.Lname;
            newBook.Email             = input.Email;
            newBook.ReservationNumber = rzlt.ReservationNumber;
            newBook.StartDate         = input.StartDate;
            newBook.AType             = apartT;

            var bookRecords = _baseService.SaveBook(newBook);


            return(rzlt);
        }