/// <summary> /// 创建文章 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int CreateArticle( Article entity ) { try { articleRepository.Add(entity); Save(); return entity.ID; }catch (Exception ex) { //log.Error(ex.Message, ex); return -1; } }
/// <summary> /// 更新文章 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool UpdateArticle( Article entity ) { try { articleRepository.Update(entity); Save(); return true; } catch (Exception ex) { //log.Error(ex.Message, ex); return false; } }