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

            if (id != educationalvisitcas.ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public IHttpActionResult Geteducationalvisitcas(int id)
        {
            educationalvisitcas educationalvisitcas = db.educationalvisitcases.Find(id);

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

            return(Ok(educationalvisitcas));
        }
Ejemplo n.º 3
0
        public IHttpActionResult Posteducationalvisitcas(educationalvisitcas educationalvisitcas)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.educationalvisitcases.Add(educationalvisitcas);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = educationalvisitcas.ID }, educationalvisitcas));
        }
Ejemplo n.º 4
0
        public IHttpActionResult Deleteeducationalvisitcas(int id)
        {
            educationalvisitcas educationalvisitcas = db.educationalvisitcases.Find(id);

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

            db.educationalvisitcases.Remove(educationalvisitcas);
            db.SaveChanges();

            return(Ok(educationalvisitcas));
        }