Extract Type Refactoring
Extract a type into its own definition and improve the reusability in your code.
If you have an anonymous type defined, you can extract it into a standalone type and reuse it across your code.
Invoke Refactor this with ^T (macOS) / Ctrl+Alt+Shift+T (Windows/Linux), on the anonymous type, then select the Extract type from the list of available refactorings.
Give it a name and start reusing the newly created type in your code.