public async Task <IActionResult> Edit(int id, [Bind("DirectionsID,Name")] DirectionsOfTraining directionsOfTraining)
        {
            if (id != directionsOfTraining.DirectionsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(directionsOfTraining);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DirectionsOfTrainingExists(directionsOfTraining.DirectionsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(directionsOfTraining));
        }
        public async Task <IActionResult> Create([Bind("DirectionsID,Name")] DirectionsOfTraining directionsOfTraining)
        {
            if (ModelState.IsValid)
            {
                _context.Add(directionsOfTraining);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(directionsOfTraining));
        }