Example #1
0
        public Core.Dto.Privilege Create(Core.Dto.Privilege privilegeDto)
        {
            var privilege = privilegeDto.ConvertToEntity();

            _unitOfWork.BeginTransaction();
            _unitOfWork.PrivilegeRepository.Create(privilege);

            privilegeDto = privilege.ConvertToDto();

            _unitOfWork.Commit();

            return(privilegeDto);
        }
Example #2
0
        public Core.Dto.Privilege Update(Core.Dto.Privilege privilegeDto)
        {
            var existingPrivilegeDto = _unitOfWork.PrivilegeRepository.Get(privilegeDto.Id).ConvertToDto();

            existingPrivilegeDto.Name      = privilegeDto.Name;
            existingPrivilegeDto.FeatureId = privilegeDto.FeatureId;
            existingPrivilegeDto.Enabled   = privilegeDto.Enabled;
            _unitOfWork.BeginTransaction();

            var privilege = _unitOfWork.PrivilegeRepository.Update(existingPrivilegeDto.ConvertToEntity());

            _unitOfWork.Commit();

            privilegeDto = privilege.ConvertToDto();

            return(privilegeDto);
        }
Example #3
0
 public Core.Dto.Privilege Put(Core.Dto.Privilege privilege)
 {
     return(_privilegeService.Update(privilege));
 }
Example #4
0
 public Core.Dto.Privilege Post(Core.Dto.Privilege privilege)
 {
     return(_privilegeService.Create(privilege));
 }