public IHttpActionResult AddCampBooking(BookingPresentationModel campBookingPresentationObject, int id) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } campBookingPresentationObject.CampId = id; // Mapping From CampPresentationModel to CampBussinessEntityModel BookingBussinessEntity campBussinessObject = MapperFromPresenationtoBL.Mapping <BookingPresentationModel, BookingBussinessEntity>(campBookingPresentationObject); string result = CampBookingServiceforBL.CampBooking(campBussinessObject); if (result != null) { return(Ok(result)); } else { throw new Exception(); } } catch (Exception e) { return(Ok(e.ToString())); } }
public BookingPresentationModel GetBookingDetailsByReferenceID(string referenceid) { BookingBussinessEntity campBussinessObject = CampBookingServiceforBL.GetBookingDetailsByReferenceID(referenceid); BookingPresentationModel campofPL = MapperFromPresenationtoBL.Mapping <BookingBussinessEntity, BookingPresentationModel>(campBussinessObject); return(campofPL); }