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

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

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

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

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

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

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

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

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

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

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

            return(Ok(tbl_DarussalamMobileCart));
        }