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

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

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

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

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

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

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

            db.users_qualify.Add(users_qualify);
            await db.SaveChangesAsync();

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

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

            db.users_qualify.Remove(users_qualify);
            await db.SaveChangesAsync();

            return(Ok(users_qualify));
        }