Add logic to keep entities in attributes when NoExpand is set. RT #88973