public async Task <IActionResult> PutAccountProfile(long id, AccountProfile accountProfile) { if (id != accountProfile.Id) { return(BadRequest()); } _context.Entry(accountProfile).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!accountProfileExist(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <AccountProfile> > PostAccountProfile(AccountProfile accountProfile) { _context.AccountProfiles.Add(accountProfile); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(AccountProfile), new { id = accountProfile.Id }, accountProfile)); }