예제 #1
0
        public async Task <IHttpActionResult> PutSCOUTING2019(int id, SCOUTING2019 sCOUTING2019)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #2
0
        public async Task <IHttpActionResult> GetSCOUTING2019(int id)
        {
            SCOUTING2019 sCOUTING2019 = await db.SCOUTING2019.FindAsync(id);

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

            return(Ok(sCOUTING2019));
        }
예제 #3
0
        public async Task <IHttpActionResult> PostSCOUTING2019(SCOUTING2019 sCOUTING2019)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            db.SCOUTING2019.Add(sCOUTING2019);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = sCOUTING2019.Id }, sCOUTING2019));
        }
예제 #4
0
        public async Task <IHttpActionResult> DeleteSCOUTING2019(int id)
        {
            SCOUTING2019 sCOUTING2019 = await db.SCOUTING2019.FindAsync(id);

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

            db.SCOUTING2019.Remove(sCOUTING2019);
            await db.SaveChangesAsync();

            return(Ok(sCOUTING2019));
        }