Пример #1
0
        public async Task <ActionResult <LesServices> > PostLesServices(LesServices lesServices)
        {
            _context.lesServices.Add(lesServices);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLesServices", new { id = lesServices.Id }, lesServices));
        }
Пример #2
0
        public async Task <IActionResult> PutLesServices(int id, LesServices lesServices)
        {
            if (id != lesServices.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }