示例#1
0
        public IHttpActionResult PostBranch(Branch branch)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Branch.Add(branch);
            db.Complete();

            return(CreatedAtRoute("DefaultApi", new { id = branch.Id }, branch));
        }
示例#2
0
        public IHttpActionResult PostVehicle(Vehicle vehicle)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Vehicle.Add(vehicle);
            db.Complete();

            return(CreatedAtRoute("DefaultApi", new { id = vehicle.Id }, vehicle));
        }
示例#3
0
        public IHttpActionResult PostRating(Rating rating)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Rating.Add(rating);
            db.Complete();

            return(CreatedAtRoute("DefaultApi", new { id = rating.Id }, rating));
        }
示例#4
0
        public IHttpActionResult PostService(Service service)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Service.Add(service);
            db.Complete();

            return(CreatedAtRoute("DefaultApi", new { id = service.Id }, service));
        }
        public IHttpActionResult PostPictureConfirmation(PictureConfirmation pictureConfirmation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.PictureConfirmation.Add(pictureConfirmation);
            db.Complete();

            return(CreatedAtRoute("DefaultApi", new { id = pictureConfirmation.Id }, pictureConfirmation));
        }
        public IHttpActionResult PostReservation(Reservation reservation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Reservation.Add(reservation);
            db.Complete();

            return(CreatedAtRoute("DefaultApi", new { id = reservation.Id }, reservation));
        }