コード例 #1
0
        public async Task <IHttpActionResult> PostC102575814Interest(C102575814Interest c102575814Interest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.C102575814Interest.Add(c102575814Interest);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (C102575814InterestExists(c102575814Interest.InterestCode))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = c102575814Interest.InterestCode }, c102575814Interest));
        }
コード例 #2
0
        public async Task <IHttpActionResult> PutC102575814Interest(string id, C102575814Interest c102575814Interest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #3
0
        public async Task <IHttpActionResult> GetC102575814Interest(string id)
        {
            C102575814Interest c102575814Interest = await db.C102575814Interest.FindAsync(id);

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

            return(Ok(c102575814Interest));
        }
コード例 #4
0
        public async Task <IHttpActionResult> DeleteC102575814Interest(string id)
        {
            C102575814Interest c102575814Interest = await db.C102575814Interest.FindAsync(id);

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

            db.C102575814Interest.Remove(c102575814Interest);
            await db.SaveChangesAsync();

            return(Ok(c102575814Interest));
        }