示例#1
0
        public void Delete_WithExistingModel_ShouldRemoveStorageOption()
        {
            SetUp();

            SeedData();
            var sorageOption = _context.StorageOptions.First();

            _storageOptionService.Delete(sorageOption.StorageOptionId);

            Assert.DoesNotContain(sorageOption, _context.StorageOptions);
        }
示例#2
0
        public IActionResult DeleteConfirmed(int id)
        {
            var    storage = _service.GetStorageOptionById(id);
            string imgUrl  = storage.ImgUrl;

            if (imgUrl != Constants.DEFAULT_STORAGE_IMG)
            {
                _driveService.DeleteFile(imgUrl);
            }

            _service.Delete(id);
            return(RedirectToAction(nameof(Index)));
        }