Пример #1
0
        public async Task <ActionResult <TblCustomerTt> > PostTblCustomerTt(TblCustomerTt tblCustomerTt)
        {
            _context.TblCustomerTt.Add(tblCustomerTt);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTblCustomerTt", new { id = tblCustomerTt.Id }, tblCustomerTt));
        }
Пример #2
0
        public async Task <IActionResult> PutTblCustomerTt(long id, TblCustomerTt tblCustomerTt)
        {
            if (id != tblCustomerTt.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }