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

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

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

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

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

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

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

            db.Transfer_SID.Add(transfer_SID);
            await db.SaveChangesAsync();

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

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

            db.Transfer_SID.Remove(transfer_SID);
            await db.SaveChangesAsync();

            return(Ok(transfer_SID));
        }