예제 #1
0
        public bool Delete(string id, bool isLogic = true)
        {
            var result = false;

            try
            {
                if (!string.IsNullOrWhiteSpace(id))
                {
                    if (isLogic)
                    {
                        var model = _article.Find(x => x.ArticleId == id);
                        if (model != null)
                        {
                            _article.Update(model);
                            result = true;
                        }
                    }
                    else
                    {
                        _article.Delete(id);
                        result = true;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(result);
        }
예제 #2
0
 public void Delete(string id, bool isLogic = true)
 {
     if (string.IsNullOrWhiteSpace(id))
     {
         return;
     }
     if (isLogic)
     {
         var model = _category.Find(x => x.CategoryId == id);
         if (model != null)
         {
             _category.Update(model);
         }
     }
     else
     {
         _category.Delete(id);
     }
 }
예제 #3
0
 public void Delete(string id, bool isLogic = true)
 {
     if (!string.IsNullOrWhiteSpace(id))
     {
         if (isLogic)
         {
             var model = _article.Find(x => x.ArticleId == id);
             if (model != null)
             {
                 model.Status = 103;
                 _article.Update(model);
             }
         }
         else
         {
             _article.Delete(id);
         }
     }
 }