コード例 #1
0
        public async Task <IHttpActionResult> PutTotales_509(int id, Totales_509 totales_509)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #2
0
        public async Task <IHttpActionResult> GetTotales_509(int id)
        {
            Totales_509 totales_509 = await db.Totales_509.FindAsync(id);

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

            return(Ok(totales_509));
        }
コード例 #3
0
        public async Task <IHttpActionResult> PostTotales_509(Totales_509 totales_509)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Totales_509.Add(totales_509);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = totales_509.id }, totales_509));
        }
コード例 #4
0
        public async Task <IHttpActionResult> DeleteTotales_509(int id)
        {
            Totales_509 totales_509 = await db.Totales_509.FindAsync(id);

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

            db.Totales_509.Remove(totales_509);
            await db.SaveChangesAsync();

            return(Ok(totales_509));
        }