Act on entities being assembled before rendering.
Drupal\Core\Entity\EntityInterface $entity: The entity object.
$view_mode: The view mode the entity is rendered in.
$langcode: The language code used for rendering.
The module may add elements to $entity->content prior to rendering. The structure of $entity->content is a renderable array as expected by drupal_render().
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_entity_view(Drupal\Core\Entity\EntityInterface $entity, $view_mode, $langcode) {
$entity->content['my_additional_field'] = array(
'#markup' => $additional_field,
'#weight' => 10,
'#theme' => 'mymodule_my_additional_field',
);
}