Esempio n. 1
0
        public async Task <IActionResult> PutTpGuests(Guid id, TpGuests tpGuests)
        {
            if (id != tpGuests.GestId)
            {
                return(BadRequest());
            }

            _context.Entry(tpGuests).State = EntityState.Modified;

            try {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException) {
                if (!TpGuestsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <ActionResult <TpGuests> > PostTpGuests(TpGuests tpGuests)
        {
            _context.TpGuests.Add(tpGuests);
            await _context.Database.ExecuteSqlRawAsync("tpsrv_logon", new SqlParameter("@Login", "sa"), new SqlParameter("@Password", "tillypad"));

            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTpGuests", new { id = tpGuests.GestId }, tpGuests));
        }