コード例 #1
0
        public void DeleteTest()
        {
            var model = _applicationDbContext.Types.First();

            _typesService.Delete(model.ID);

            Assert.IsFalse(_applicationDbContext.Types.Any(t => t.ID == model.ID));
        }
コード例 #2
0
        public ActionResult Delete(int id)
        {
            try
            {
                _typesService.Delete(id);
            }
            catch
            {
                return(HttpNotFound());
            }

            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public int Delete(int TypeID)
 {
     try
     {
         int res = _TypesService.Delete(TypeID);
         return(res);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex.Message);
         throw ex;
     }
 }