How to create dependent fields in Entity:baseFieldDefinition? I have created a select list of content types in baseFieldDefinition

$fields['ctype'] = BaseFieldDefinition::create('list_string')
      -&gt;setLabel(t('Content Type'))
      -&gt;setDescription(t('Choose content type '))
      -&gt;setRequired(TRUE)
      -&gt;setSettings(array(
        'allowed_values' =&gt; $ctypes,
      ))
      -&gt;setDisplayOptions('view', array(
        'label' =&gt; 'above',
        'type' =&gt; 'string',
        'weight' =&gt; -5,
      ))
      -&gt;setDisplayOptions('form', array(
        'type' =&gt; 'options_select',
        'weight' =&gt; -5,
      ))
      -&gt;setDisplayConfigurable('form', TRUE)
      -&gt;setDisplayConfigurable('view', TRUE);


Does Drupal provides ajax feature to use in baseFieldDefinition ?

Basically I want to generate field list of selected content type using entity.
Does Drupal provides ajax feature to use in baseFieldDefinition ?


Short answer: no

Long answer:

The base field definition method is used to define the entity structure and the database structure.

If you are trying to display different form items when the toe changes then you should do that on the form object level. By adding a #ajax attribute to the type field.