Ejemplo n.º 1
0
        public async Task <ActionResult <VisitTasks> > PostVisitTasks(VisitTasks visitTasks)
        {
            _context.VisitTasks.Add(visitTasks);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetVisitTasks", new { id = visitTasks.TaskId }, visitTasks));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutVisitTasks(decimal id, VisitTasks visitTasks)
        {
            if (id != visitTasks.TaskId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }