public async Task <IActionResult> PutDbo_LendingOfficers(string id, Dbo_LendingOfficers dbo_LendingOfficers) { if (id != dbo_LendingOfficers.Username) { return(BadRequest()); } _context.Entry(dbo_LendingOfficers).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Dbo_LendingOfficersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Dbo_LendingOfficers> > PostDbo_LendingOfficers(Dbo_LendingOfficers dbo_LendingOfficers) { _context.LendingOfficers.Add(dbo_LendingOfficers); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (Dbo_LendingOfficersExists(dbo_LendingOfficers.Username)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetDbo_LendingOfficers", new { id = dbo_LendingOfficers.Username }, dbo_LendingOfficers)); }