예제 #1
0
 public Task <int> UpdateAsync(AdminUpdatePostWrapper wrapper)
 {
     return(Task.Run(() =>
     {
         return Update(wrapper);
     }));
 }
예제 #2
0
        public int Update(AdminUpdatePostWrapper wrapper)
        {
            var entity = _unitOfWork.PostRepository.Get(wrapper.PostId);

            entity.PostTitle       = wrapper.PostTitle;
            entity.Permerlink      = wrapper.Permerlink;
            entity.PostStatus      = wrapper.PostStatus;
            entity.Content         = wrapper.Content;
            entity.CoverImageId    = wrapper.CoverImageId;
            entity.LastUpdatedDate = DateTime.Now;
            entity.LastUpdatedBy   = wrapper.UserId;

            _unitOfWork.PostRepository.Update(entity);
            return(_unitOfWork.SaveChanges());
        }