Ejemplo n.º 1
0
        public async Task <ActionResult> DeleteConferm(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var news = _newsServices.Find((Guid)id);

            if (news == null)
            {
                return(HttpNotFound());
            }

            var result = await _newsServices.DeleteAsync(news.NewsId);

            if (result.Success)
            {
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", string.Format("Update Invalid Error Is {0}", result.InnerExeption));
            return(View(news));
        }