public ActionResult Delete(int id)
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new SpellService(userId);

            service.Delete(id);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(string id)
        {
            if (!(await m_service.Delete(id)))
            {
                return(NotFound());
            }

            return(Ok());
        }
Exemplo n.º 3
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (_spell == null)
            {
                return;
            }

            var confirmResult = MessageBox.Show(@"Are you sure to delete the selected object",
                                                @"Confirm Delete!!",
                                                MessageBoxButtons.YesNo);

            if (confirmResult != DialogResult.Yes)
            {
                return;
            }

            _spellService.Delete(_spell);
            Clear();
        }