示例#1
0
        public async Task <IActionResult> PutContactenosItem(long id, ContactenosItem contactenosItem)
        {
            if (id != contactenosItem.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
示例#2
0
        public async Task <ActionResult <ContactenosItem> > PostContactenosItem(ContactenosItem contactenosItem)
        {
            _context.ContactenosItems.Add(contactenosItem);
            await _context.SaveChangesAsync();

            //return CreatedAtAction("GetContactenosItem", new { id = contactenosItem.Id }, contactenosItem);
            return(CreatedAtAction(nameof(GetContactenosItem), new { id = contactenosItem.Id }, contactenosItem));
        }