Ejemplo n.º 1
0
        public async Task <IActionResult> PutCatchServiceEmployee(int id, CatchServiceEmployee catchServiceEmployee)
        {
            if (id != catchServiceEmployee.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <CatchServiceEmployee> > PostCatchServiceEmployee(CatchServiceEmployee catchServiceEmployee)
        {
            _context.CatchServiceEmployees.Add(catchServiceEmployee);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCatchServiceEmployee", new { id = catchServiceEmployee.Id }, catchServiceEmployee));
        }