Exemplo n.º 1
0
        public IHttpActionResult PostTrainerEdnDetail(TrainerEdnDetail traineredndetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TrainerEdnDetails.Add(traineredndetail);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = traineredndetail.TrainerEdnId }, traineredndetail));
        }
Exemplo n.º 2
0
        public IHttpActionResult DeleteTrainerEdnDetail(int id)
        {
            TrainerEdnDetail traineredndetail = db.TrainerEdnDetails.Find(id);

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

            db.TrainerEdnDetails.Remove(traineredndetail);
            db.SaveChanges();

            return(Ok(traineredndetail));
        }