Example #1
0
        public IHttpActionResult Putmulti_pitch(int id, multi_pitch multi_pitch)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != multi_pitch.id_multi_pitch)
            {
                return(BadRequest());
            }

            db.Entry(multi_pitch).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!multi_pitchExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
        public IHttpActionResult Getmulti_pitch(int id)
        {
            multi_pitch multi_pitch = db.multi_pitch.Find(id);

            if (multi_pitch == null)
            {
                return(NotFound());
            }

            return(Ok(multi_pitch));
        }
Example #3
0
        public IHttpActionResult Postmulti_pitch(multi_pitch multi_pitch)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.multi_pitch.Add(multi_pitch);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = multi_pitch.id_multi_pitch }, multi_pitch));
        }
Example #4
0
        public IHttpActionResult Deletemulti_pitch(int id)
        {
            multi_pitch multi_pitch = db.multi_pitch.Find(id);

            if (multi_pitch == null)
            {
                return(NotFound());
            }

            db.multi_pitch.Remove(multi_pitch);
            db.SaveChanges();

            return(Ok(multi_pitch));
        }