示例#1
0
        public async Task <IActionResult> RemoveTopic(int id)
        {
            var topic = await _topics.GetByIdWithUserAsync(id);

            if (await _topics.DeleteAsync(id, User.Identity.Name))
            {
                return(RedirectToAction("Category", "Home", new { id = topic.CategoryId }));
            }
            return(BadRequest(_topics.LastError));
        }