Exemplo n.º 1
0
        public async Task <IActionResult> Edit(Thread thread, string tags)
        {
            if (thread == null)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _service.Edit(thread);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!_service.ThreadExists(thread.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                _service.ChangeTags(thread, tags);
                return(RedirectToAction("Index", "Thread", new { @id = thread.ID }));
            }

            return(View(thread));
        }