public ActionResult DeleteConfirmed(int id)
        {
            Platform platform = _platformService.Find(id);

            _platformService.Delete(platform);
            return(RedirectToAction("Manage"));
        }
        public async Task <IActionResult> Delete(int id)
        {
            var errorResult = _platformService.Delete(id);

            if (errorResult != ErrorResult.None)
            {
                return(new InternalErrorObjectResult(_errorCreator.CreateApplicationError(new[] { $"Could not delete platform with Id:'{id}'", errorResult.Message }.ToList(), Guid.NewGuid().ToString())));
            }

            return(Ok());
        }
Пример #3
0
        public IActionResult Delete(PlatformDeleteViewModel viewModel)
        {
            Platform platform = platformService.GetByID(viewModel.Platform.ID);

            if (platform == null)
            {
                return(NotFound());
            }

            platformService.Delete(platform.ID);
            return(RedirectToAction("Index"));
        }
Пример #4
0
        /// <summary>
        /// function for deleting data
        /// </summary>

        public IActionResult Delete(int id)
        {
            _platformService.Delete(id);
            return(RedirectToAction(nameof(Index)));
        }
Пример #5
0
        public IActionResult Remove(string platformName)
        {
            _platformService.Delete(platformName);

            return(Ok(platformName));
        }