Beispiel #1
0
        public async Task <IHttpActionResult> PutPedimentos_Global(int id, Pedimentos_Global pedimentos_Global)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

            try {
                await db.SaveChangesAsync();
            } catch (DbUpdateConcurrencyException) {
                if (!Pedimentos_GlobalExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public async Task <IHttpActionResult> GetPedimentos_Global(int id)
        {
            Pedimentos_Global pedimentos_Global = await db.Pedimentos_Global.FindAsync(id);

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

            return(Ok(pedimentos_Global));
        }
Beispiel #3
0
        public async Task <IHttpActionResult> PostPedimentos_Global(Pedimentos_Global pedimentos_Global)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Pedimentos_Global.Add(pedimentos_Global);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = pedimentos_Global.Id }, pedimentos_Global));
        }
Beispiel #4
0
        public async Task <IHttpActionResult> DeletePedimentos_Global(int id)
        {
            Pedimentos_Global pedimentos_Global = await db.Pedimentos_Global.FindAsync(id);

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

            db.Pedimentos_Global.Remove(pedimentos_Global);
            await db.SaveChangesAsync();

            return(Ok(pedimentos_Global));
        }