Example #1
0
        public async Task <ActionResult <CitaItem> > PostCitaItem(CitaItem item)
        {
            _context.CitaItems.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetCitaItem), new { id = item.Id }, item));
        }
Example #2
0
        public async Task <IActionResult> PutCitaItem(int id, CitaItem item)
        {
            if (id != item.Id)
            {
                return(BadRequest());
            }
            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }