MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

MentorActionRegistration record

The MentorActionRegistration record of Novior.MentorAgent.Abstractions.Models: One place the application declares actions in, from…

View as Markdown
On this page

One place the application declares actions in, from IMentorActionCatalog.GetRegistrations: a class read for its attributes, the actions registered in code for one class, an endpoint declared as an action, a page with the UI actions it declared, and in later versions other sources. Every action of IMentorActionCatalog.GetActions names its registration with MentorActionInfo.RegistrationId; a page's UI actions are not in that list. More properties may be added.

Namespace: Novior.MentorAgent.Abstractions.Models. Package: Novior.MentorAgent.Abstractions.

public sealed record MentorActionRegistration : IEquatable<MentorActionRegistration>

Terminal
dotnet add package Novior.MentorAgent.Abstractions

public MentorActionRegistration()

public IReadOnlyList<string> Actions { get; init; }

The tool names of the actions it gives, in the order discovery finds them, those shipped off included. For a page, the names of the UI actions it declared since the application started, in the order first seen, within MentorPageActionLimits: an action the page no longer declares stays in the list.

public bool Enabled { get; init; }

Whether the registration is on. A registration whose source the application switches off as a whole is in the list with false; one action shipped off is still listed in MentorActionRegistration.Actions, and MentorActionInfo.EnabledByDefault says it is off.

public required string Id { get; init; }

The registration's id, the same from one start to the next: MentorActionRegistration.Origin, a colon and MentorActionRegistration.Source (for example fluent:Shop.OrderActions, endpoint:POST /orders/{id}/cancel, or page:Orders). A class with actions of both origins has two registrations.

public required string Origin { get; init; }

How the application declares these actions: one of MentorActionOrigins, an open code.

public string? Page { get; init; }

The page these actions belong to, for a page's registration; null otherwise.

public IReadOnlyList<MentorActionRejection> Rejected { get; init; }

What it left out, and by which rule. Empty when everything it declares is an action.

public long Revision { get; init; }

For a page, the value one counter of the process had when this registration last changed: an action or a rejection it did not list before. The counter grows only at a change, and the same declaration made again does not move it, so the highest revision of the list says whether anything changed since it was last read, and each page's says which. Always 0 for the registrations of the code, which are fixed when the application starts.

public required string Source { get; init; }

What declares them: for attributes and for the actions registered in code, the class's full name; for an endpoint, its verb and its route as mapped (POST /orders/{id}/cancel), one registration per endpoint; for a command or a query, its type's full name, one registration per type; for a page, the page's name, as the page set it.