Пример #1
0
        public async Task <ActionResult <HrmEmployeeGroup> > PostHrmEmployeeGroup(HrmEmployeeGroup hrmEmployeeGroup)
        {
            _context.HrmEmployeeGroups.Add(hrmEmployeeGroup);
            await _context.SaveChangesAsync();

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

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

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

            return(NoContent());
        }