public async Task <ActionResult <UbicationGroup> > PostUbicationGroup(UbicationGroup ubicationGroup) { _context.UbicationGroups.Add(ubicationGroup); await _context.SaveChangesAsync(); return(CreatedAtAction("GetUbicationGroup", new { id = ubicationGroup.Id }, ubicationGroup)); }
public async Task <IActionResult> PutUbicationGroup(int id, UbicationGroup ubicationGroup) { if (id != ubicationGroup.Id) { return(BadRequest()); } _context.Entry(ubicationGroup).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UbicationGroupExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }