Exemplo n.º 1
0
        public async Task <IActionResult> Create(EditBand model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _service.CreateBand(model.Name);

                    return(RedirectToAction(nameof(Index)));
                }
            }
            catch (BadRequestException e)
            {
                ModelState.AddModelError("", e.Message);
            }

            return(View(model));
        }