예제 #1
0
        public bool Insert(BlogDto blogDto)
        {
            var blog = _mapper.Map <Blog>(blogDto);

            _unitOfWorfk.BlogRepository.Add(blog);

            return(_unitOfWorfk.SaveChanges() > 0);
        }
예제 #2
0
        public bool Update(BlogDto blogDto)
        {
            var entity = _mapper.Map <Blog>(blogDto);

            entity.UpdatedDate = DateTime.UtcNow;
            entity.UpdatedBy   = "ADMIN";
            _unitOfWorfk.BlogRepository.Update(entity, AccessPropertyMode.DENY_UPDATE, "CreatedBy", "CreatedDate", "NotUse");
            return(_unitOfWorfk.SaveChanges() > 0);
        }