Beispiel #1
0
        public async Task <IActionResult> PutmudPump(int id, mudPump mudPump)
        {
            if (id != mudPump.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #2
0
        //этот метод получает значения элемента из списка буровых насосов из текста http запроса
        public async Task <ActionResult <mudPump> > PostmudPump(mudPump mudPump)
        {
            _context.mudPumps.Add(mudPump);
            await _context.SaveChangesAsync();

            //return CreatedAtAction("GetmudPump", new { id = mudPump.ID }, mudPump);
            return(CreatedAtAction(nameof(GetmudPump), new { id = mudPump.id }, mudPump));
        }