How to inject User class as dependency? How to do I inject Drupal\user\Entity\User class as dependency? I could not find service name in service list.
 for example:

$user = User::load($this-&gt;currentUser-&gt;id())


for this code I want to call like this

$user = $this-&gt;user-&gt;load(($this-&gt;currentUser-&gt;id())


when injecting in Controller. How can I achieve this?
You don't have to inject services in the controller, because ControllerBase already provides the services needed. So this should work:

$user = $this-&gt;entityTypeManager()-&gt;getStorage('user')-&gt;load($this-&gt;currentUser()-&gt;id());




For other services not included in ControllerBase, see How do I use dependency injection on \Drupal::moduleHandler() to a Controller?