public async Task <IActionResult> PutFirmiSopstvenici([FromRoute] int id, [FromBody] FirmiSopstvenici firmiSopstvenici) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != firmiSopstvenici.Id) { return(BadRequest()); } _context.Entry(firmiSopstvenici).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FirmiSopstveniciExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostFirmiSopstvenici([FromBody] FirmiSopstvenici firmiSopstvenici) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.FirmiSopstvenici.Add(firmiSopstvenici); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFirmiSopstvenici", new { id = firmiSopstvenici.Id }, firmiSopstvenici)); }