public async Task <IActionResult> PutAuthorisedperson2177(int id, Authorisedperson2177 authorisedperson2177) { if (id != authorisedperson2177.Userid) { return(BadRequest()); } _context.Entry(authorisedperson2177).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Authorisedperson2177Exists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Authorisedperson2177> > PostAuthorisedperson2177(Authorisedperson2177 ap) { // _context.Authorisedperson2177.Add(authorisedperson2177); var authorisedPersonAccountID = await Task.FromResult(_context.Authorisedperson2177.FromSqlRaw("EXEC ADD_AUTHORISED_PERSON " + "@PFIRSTNAME = " + ap.Firstname + ", @PSURNAME = " + ap.Surname + ", @PEMAIL = " + ap.Email + ", @PPASSWORD = "******", @PACCOUNTID = " + ap.Accountid).ToList()); // await _context.SaveChangesAsync(); return(authorisedPersonAccountID[0]); }