public ActionResult Post(Book book) { ActionResult response = BadRequest("invalid data"); Transaction transaction = _patientService.Book(book); if (transaction != null) { UserProfileModel userProfile = _userService.GetUserProfile(book.patientId); Data data = new Data { Id = book.patientId, Image = userProfile.Image, Lat = book.location.lat, Long = book.location.longt, Name = userProfile.Fname + " " + userProfile.Lname, Tans_Id = transaction.Id, body = "waiting to approve your request", title = "You have a request" }; _notificationService.SendNotification(_userService.GetTokens(book.doctorId), data); _notificationService.AddNotification(new Notification { Date = DateTime.Now, Message = "waiting to approve your request", Read = true, Tans_Id = transaction.Id, UserFrom_Id = book.patientId, UserTo_Id = book.doctorId }); response = Ok(); } return(response); }