This is covered in the Visualizing Spatial Data tutorial. The primitive.id property of the pick will be the Entity instance.