public async Task <IActionResult> PutTarget(int id, TargetInputModel input)
        {
            if (id != input.Id)
            {
                return(BadRequest());
            }

            var target = _context.Targets.Find(id);

            target.Text  = input.Text;
            target.Color = ColorTranslator.FromHtml(input.Color);

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

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

            return(NoContent());
        }
        public async Task <ActionResult <Target> > PostTarget(TargetInputModel input)
        {
            Target target = new Target {
                Text  = input.Text,
                Color = ColorTranslator.FromHtml(input.Color),
            };

            _context.Targets.Add(target);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTarget", new { id = target.Id }, target));
        }