Skip to content

Built-in Tools

IMvcDescriptionExtractor

IMvcDescriptionExtractor is a service that inspects an ASP.NET Core MVC application and extracts detailed metadata about its controllers, actions, and any classes used in decorated actions.

Purpose

  • Analyze an MVC application structure.
  • List all discovered controller actions.
  • Identify all classes referenced by actions (e.g., request DTOs, response types).
  • Provide inputs for the following generation.

Members

IEnumerable<ControllerAction> FetchControllerActions(MvcExtractionOptions options = null)

Returns a list of all controller actions found in the current MVC project. Extraction behavior can be customized using MvcExtractionOptions.

Parameters:

  • options(optional) Extraction settings such as filters, grouping, etc.

Returns: A collection of ControllerAction objects.


IEnumerable<TypeDescription> FetchActionsClasses(IEnumerable<ControllerAction> controllerActions = null)

Returns all classes used by decorated actions. This includes request/response DTOs, models, or other types tied to actions decorated with:

  • [IncludeActionAttribute]
  • [IncludeControllerAttribute]

Parameters:

  • controllerActions(optional) If provided, only these actions will be used; if null, all controller actions will be fetched automatically.

Returns: A collection of TypeDescription objects.

ISourceRepository

ISourceRepository is a reflection-driven repository that serves as the central index for all extracted elements from your source application that are needed by the Client Builder.

It acts like a filtered catalog for:

  • Classes
  • Enums
  • Decorated elements

Purpose

  • Centralize discovery of all available types in the target project.
  • Filter what should be included based on custom rules or attributes.
  • Provide clean inputs for code generators, documentation tools, or SDK builders.

Members

IEnumerable<TypeDescription> Fetch(Func<SourceAssemblyType, bool> filter)

Fetches all types (classes, interfaces, enums, etc.) that match a custom filter.

Parameters:

  • filter: A Func predicate that defines which types to include.

Returns: A list of TypeDescription objects matching the criteria.


IEnumerable<TypeDescription> FetchEnums(Func<SourceAssemblyType, bool> filter = null)

Fetches all enums in the source application. You can pass an optional filter to refine the results.

Parameters:

  • filter: (optional) Additional filter for enums.

Returns: A list of TypeDescription objects describing each enum.


IEnumerable<TypeDescription> FetchIncludedEnums(Func<SourceAssemblyType, bool> filter = null)

Fetches only the enums that are explicitly marked with the [IncludeElementAttribute].

Parameters:

  • filter: (optional) Additional filter for included enums.

Returns: A list of TypeDescription objects for all decorated enums.


IEnumerable<TypeDescription> FetchIncludedClasses(Func<SourceAssemblyType, bool> filter = null)

Fetches only the classes that are explicitly marked with the [IncludeElementAttribute].

Parameters:

  • filter: (optional) Additional filter for included classes.

Returns: A list of TypeDescription objects for all decorated classes.

Released under the MIT License.