public void InsertUserRole(UserRoleViewModel userRole)
 {
     if (Validate(userRole.UserId, userRole.RoleId))
     {
         UserRole entity = new UserRole();
         Map(userRole, entity);
         _userRoleRepository.AttachNavigation(entity.User);
         _userRoleRepository.AttachNavigation(entity.Role);
         _userRoleRepository.Add(entity);
         _unitOfWork.SaveChanges();
     }
 }
 public void DeleteUserRole(UserRoleViewModel userRole)
 {
     UserRole entity = _userRoleRepository.GetById(userRole.Id);
     _userRoleRepository.Delete(entity);
     _unitOfWork.SaveChanges();
 }