Ejemplo n.º 1
0
        public IHttpActionResult PutSurvey_Types(int id, Survey_Types Survey_Types)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != Survey_Types.Survey_Type_ID)
            {
                return BadRequest();
            }

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

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

            return StatusCode(HttpStatusCode.NoContent);
        }
Ejemplo n.º 2
0
        public IHttpActionResult PostSurvey_Types(Survey_Types Survey_Types)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Survey_Types.Add(Survey_Types);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = Survey_Types.Survey_Type_ID }, Survey_Types);
        }