Beispiel #1
0
        public IHttpActionResult GetMalaria_Facts(int id)
        {
            Malaria_Facts malaria_Facts = db.Malaria_Facts.Find(id);

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

            return(Ok(malaria_Facts));
        }
Beispiel #2
0
        public IHttpActionResult DeleteMalaria_Facts(int id)
        {
            if (!IsAuthorized("Write"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            Malaria_Facts malaria_Facts = db.Malaria_Facts.Find(id);

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

            db.Malaria_Facts.Remove(malaria_Facts);
            db.SaveChanges();

            LogAction("Malaria_Facts");

            return(Ok(malaria_Facts));
        }
Beispiel #3
0
        public IHttpActionResult PutMalaria_Facts(int id, Malaria_Facts malaria_Facts)
        {
            if (!IsAuthorized("Write"))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            LogAction("Malaria_Facts");

            return(StatusCode(HttpStatusCode.NoContent));
        }