public Task <int> UpdateAsync(AdminUpdatePostWrapper wrapper) { return(Task.Run(() => { return Update(wrapper); })); }
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()); }