public async Task <IActionResult> PutTpMenuItems(Guid id, TpMenuItems tpMenuItems) { if (id != tpMenuItems.MitmId) { return(BadRequest()); } _context.Entry(tpMenuItems).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TpMenuItemsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TpMenuItems> > PostTpMenuItems(TpMenuItems tpMenuItems) { _context.TpMenuItems.Add(tpMenuItems); await _context.Database.ExecuteSqlRawAsync("tpsrv_logon", new SqlParameter("@Login", "sa"), new SqlParameter("@Password", "tillypad")); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTpMenuItems", new { id = tpMenuItems.MitmId }, tpMenuItems)); }