public async Task <IActionResult> PutTpUserLocationPresence([FromBody] TpUserLocationPresence tpUserLocationPresence) { //if(id != tpUserLocationPresence.UslpId) { // return BadRequest(); //} _context.Entry(tpUserLocationPresence).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TpUserLocationPresenceExists(tpUserLocationPresence.UslpId)) { return(NotFound()); } else { throw; } } return(Accepted()); }
public async Task <ActionResult <TpUserLocationPresence> > PostTpUserLocationPresence([FromBody] TpUserLocationPresence tpUserLocationPresence) { _context.TpUserLocationPresence.Add(tpUserLocationPresence); try { await _context.Database.ExecuteSqlRawAsync("tpsrv_logon", new SqlParameter("@Login", "sa"), new SqlParameter("@Password", "tillypad")); await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TpUserLocationPresenceExists(tpUserLocationPresence.UslpId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTpUserLocationPresence", new { id = tpUserLocationPresence.UslpId }, tpUserLocationPresence)); }