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); }
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); }
public Core.Dto.Privilege Put(Core.Dto.Privilege privilege) { return(_privilegeService.Update(privilege)); }
public Core.Dto.Privilege Post(Core.Dto.Privilege privilege) { return(_privilegeService.Create(privilege)); }