public async Task <IActionResult> PutEmployee(Guid id, Employee employee) { if (id != employee.EmployeeId) { return(BadRequest()); } _context.Entry(employee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFresher(string id, Fresher fresher) { if (id != fresher.FresherId) { return(BadRequest()); } _context.Entry(fresher).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FresherExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }