Beispiel #1
0
 public ContentEntity Create(ContentEntity entity)
 {
     try
     {
         _contentRepository.Insert(entity);
         return entity;
     }
     catch (Exception e)
     {
         _log.Error(e,"数据库操作出错");
         return null;
     }
 }
Beispiel #2
0
 public bool Delete(ContentEntity entity)
 {
     try
     {
         _contentRepository.Delete(entity);
         return true;
     }
     catch (Exception e)
     {
         _log.Error(e,"数据库操作出错");
         return false;
     }
 }
Beispiel #3
0
        public bool Post(ContentModel model)
        {
            var entity = new ContentEntity
            {

                Content = model.Content,

                Title = model.Title,

                Adduser = model.Adduser,

                Addtime = model.Addtime,

                Upduser = model.Upduser,

                Updtime = model.Updtime,

                Status = model.Status,

                Praise = model.Praise,

                Unpraise = model.Unpraise,

                Viewcount = model.Viewcount,

            //				Tags = model.Tags,

            //				Channels = model.Channels,

            };
            if(_ContentService.Create(entity).Id > 0)
            {
                return true;
            }
            return false;
        }