示例#1
0
        public async Task <IActionResult> PutPpar(int id, Ppar ppar)
        {
            if (id != ppar.PparId)
            {
                return(BadRequest());
            }

            _context.Entry(ppar).State = EntityState.Modified;

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

            return(NoContent());
        }
示例#2
0
        public async Task <IActionResult> PutCont([FromRoute] int id, [FromBody] Cont cont)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            _context.Entry(cont).State = EntityState.Modified;

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

            return(NoContent());
        }
示例#3
0
        public async Task <IActionResult> PutCoun(string id, Coun coun)
        {
            if (id != coun.CounCode)
            {
                return(BadRequest());
            }

            _context.Entry(coun).State = EntityState.Modified;

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

            return(NoContent());
        }