Beispiel #1
0
        // GET: ScriptController/Delete/5
        public ActionResult Delete(string id)
        {
            var command = new ScriptDeleteCommand(id);

            scriptApplicationService.Delete(command);
            return(RedirectToAction(nameof(Index)));
        }
        private void DeleteScript()
        {
            var command = new ScriptDeleteCommand(SelectedScript.Id);

            scriptApplicationService.Delete(command);
            EditMode = false;
            ReloadScripts();
        }
        public void Delete(ScriptDeleteCommand command)
        {
            using (var transaction = new TransactionScope())
            {
                var id     = command.Id;
                var script = scriptRepository.Find(id);
                if (script == null)
                {
                    return;
                }

                scriptRepository.Delete(script);

                transaction.Complete();
            }
        }