Exemplo n.º 1
0
        public IHttpActionResult PutTAnimals_Farm_Report(int id, TAnimals_Farm_Report tAnimals_Farm_Report)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tAnimals_Farm_Report.Id)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetTAnimals_Farm_Report(int id)
        {
            TAnimals_Farm_Report tAnimals_Farm_Report = db.TAnimals_Farm_Report.Find(id);

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

            return(Ok(tAnimals_Farm_Report));
        }
Exemplo n.º 3
0
        public IHttpActionResult PostTAnimals_Farm_Report(TAnimals_Farm_Report tAnimals_Farm_Report)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TAnimals_Farm_Report.Add(tAnimals_Farm_Report);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tAnimals_Farm_Report.Id }, tAnimals_Farm_Report));
        }
Exemplo n.º 4
0
        public IHttpActionResult DeleteTAnimals_Farm_Report(int id)
        {
            TAnimals_Farm_Report tAnimals_Farm_Report = db.TAnimals_Farm_Report.Find(id);

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

            db.TAnimals_Farm_Report.Remove(tAnimals_Farm_Report);
            db.SaveChanges();

            return(Ok(tAnimals_Farm_Report));
        }