public async Task <ActionResult <BookingCM> > CreateBooking([FromBody] BookingCM serviceModel) { //TODO: Implements BookingDetail.GetById(int id) does not exist, return BadRequest() //TODO: Implements GaleryId.GetById(int id) does not exist, return BadRequest() DateTime createDate = DateTime.Now; DateTime updateDate = DateTime.Now; Booking crtBooking = _mapper.Map <Booking>(serviceModel); try { crtBooking.CreateDate = createDate; crtBooking.UpdateDate = updateDate; crtBooking.Status = "Mới"; var data = new Dictionary <String, String>(); await _service.AddAsync(crtBooking); await _service.Save(); Account customerAccount = await _accountService.GetByIdAsync(crtBooking.CustomerAccountId); data.Add("notiType", "booking_created"); data.Add("bookingId", crtBooking.Id.ToString()); _ = _pushNotificationService.SendMessage( "Bạn nhận được đơn hàng mới", "Khách hàng: " + customerAccount.DisplayName + "\n" + "Địa chỉ: " + crtBooking.EndAddress, "booking_created_id_" + crtBooking.BeautyArtistAccountId, data ); Console.WriteLine("abc"); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError)); } return(CreatedAtAction("GetBookingById", new { id = crtBooking.Id }, crtBooking)); }