コード例 #1
0
        public IActionResult Delete(int key)
        {
            var model = _leadTypeRepo.Get(key);

            _leadTypeRepo.Remove(model);

            if (_uow.Commit(this.ModelState))
            {
                if (!String.IsNullOrEmpty(model.Image))
                {
                    FileHelper.DeleteFile(Path.Combine(this.ImagePath, model.Image));
                }

                return(Ok());
            }
            else
            {
                return(BadRequest(GetFullErrorMessage(this.ModelState)));
            }
        }