public void MoveSecurityEntity(int sourceId, int targetId) { var source = _dataProvider.LoadStoredSecurityEntity(sourceId); if (source == null) { throw new EntityNotFoundException("Cannot move the entity because it does not exist: " + sourceId); } var target = _dataProvider.LoadStoredSecurityEntity(targetId); if (target == null) { throw new EntityNotFoundException("Cannot move the entity because the target does not exist: " + targetId); } // moving _dataProvider.MoveSecurityEntity(sourceId, targetId); }