Example #1
0
 public clsBookingDetails saveBookingDetails(clsBookingDetails clsBookingDetails)
 {
     clsBookingDetails.Id = "CUSTMR-" + RandomNumber(1, 1000000);
     dbContext.tblBookingDetails.Add(clsBookingDetails);
     dbContext.SaveChanges();
     return(clsBookingDetails);
 }
 public ActionResult <clsBookingDetails> saveBookingDetailsRoute([FromBody] clsBookingDetails clsBookingDetails)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest());
     }
     else
     {
         var result = bookingRepo.saveBookingDetails(clsBookingDetails);
         return(Created("", result));
     }
 }