public async Task <ActionResult <AccountNotes> > PostAccountNotes(AccountNotes accountNotes) { _context.AccountNotes.Add(accountNotes); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAccountNotes", new { id = accountNotes.AccountNotesId }, accountNotes)); }
public async Task <IActionResult> EditAccountNotes(AccountNotes accountNotes) { var entity = new AccountNotes(); var accountNoteInDb = _context.AccountNotes.FirstOrDefault(r => r.AccountNotesId == accountNotes.AccountNotesId); if (accountNoteInDb == null) { _context.Add(accountNotes); _context.SaveChanges(); return(Ok(entity)); } else { accountNoteInDb.Notes = accountNotes.Notes; _context.SaveChanges(); return(Ok(entity)); } }