Exemple #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());
        }
Exemple #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());
        }
Exemple #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());
        }