Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,MinimumConsumption,Price")] Step step)
        {
            if (id != step.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _stepRepository.UpdateStepAsync(step);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StepExists(step.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(step));
        }