public void BookWithPayment([FromBody] BookWithPayment bwp) { PlanYourTripBusinessEntity.Models.PackageBooking packageBooking = new PlanYourTripBusinessEntity.Models.PackageBooking(); packageBooking.PackageID = bwp.booking.PackageID; var userStore = new UserStore <ApplicationUser>(new ApplicationDbContext()); var userManager = new UserManager <ApplicationUser>(userStore); packageBooking.Id = userManager.FindByName(bwp.booking.UserName).Id; packageBooking.NumPeople = bwp.booking.NumPeople; packageBooking.StartDate = bwp.booking.StartDate.Date; packageBooking.EndDate = bwp.booking.EndDate.Date; packageBooking.PaymentMethod = bwp.booking.PaymentMethod; packageBooking.IsCustomized = bwp.booking.IsCustomized; packageBooking.TotalCost = bwp.booking.TotalCost; packageBooking.BookingStatus = bwp.booking.BookingStatus; Payment pay = new Payment(); pay.CreditCardNumber = bwp.payment.CreditCardNumber; pay.NameOnCard = bwp.payment.NameOnCard; pay.Amount = bwp.payment.Amount; bookingManager.BookWithPayment(packageBooking, pay); var user = userManager.FindById(packageBooking.Id); user.NumberOfTrips = user.NumberOfTrips++; userManager.Update(user); userStore.Context.SaveChanges(); }