public async Task <IHttpActionResult> PostTbl_DoithucanhtranhIMAGE(Tbl_DoithucanhtranhIMAGE tbl_DoithucanhtranhIMAGE)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Tbl_DoithucanhtranhIMAGE.Add(tbl_DoithucanhtranhIMAGE);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (Tbl_DoithucanhtranhIMAGEExists(tbl_DoithucanhtranhIMAGE.DTCTIMAGE_ID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = tbl_DoithucanhtranhIMAGE.DTCTIMAGE_ID }, tbl_DoithucanhtranhIMAGE));
        }
        public async Task <IHttpActionResult> PutTbl_DoithucanhtranhIMAGE(string id, Tbl_DoithucanhtranhIMAGE tbl_DoithucanhtranhIMAGE)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetTbl_DoithucanhtranhIMAGE(string id)
        {
            Tbl_DoithucanhtranhIMAGE tbl_DoithucanhtranhIMAGE = await db.Tbl_DoithucanhtranhIMAGE.FindAsync(id);

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

            return(Ok(tbl_DoithucanhtranhIMAGE));
        }
        public async Task <IHttpActionResult> DeleteTbl_DoithucanhtranhIMAGE(string id)
        {
            Tbl_DoithucanhtranhIMAGE tbl_DoithucanhtranhIMAGE = await db.Tbl_DoithucanhtranhIMAGE.FindAsync(id);

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

            db.Tbl_DoithucanhtranhIMAGE.Remove(tbl_DoithucanhtranhIMAGE);
            await db.SaveChangesAsync();

            return(Ok(tbl_DoithucanhtranhIMAGE));
        }