# MentorExcludeAttribute class

> The MentorExcludeAttribute class of Novior.MentorAgent.Attributes: Keeps a class or a method out of the AutoMentor's candidates (MentorAutoMentorOptions)…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-attributes/mentorexcludeattribute
- Verified with: MentorAgent 1.4.0
- Last updated: 2026-11-18
- Packages: Novior.MentorAgent

Keeps a class or a method out of the AutoMentor's candidates ([`MentorAutoMentorOptions`](https://docs.mentoragent.net/api/novior-mentoragent-options/mentorautomentoroptions)): what carries it never becomes an action by discovery, whatever its namespace, and it is not listed in the trace either (`candidate.excluded`). On a class it covers every method of the class and of the classes derived from it. It does not change an action declared with `[MentorAction]`, `[Description]` or in code.

```text title="Example"
[MentorExclude]
public sealed class PaymentGateway { … }

public sealed class OrderService
{
    public Order Find(int id) { … }

    [MentorExclude]
    public void Purge() { … }
}
```

## Definition

Namespace: `Novior.MentorAgent.Attributes`. Package: `Novior.MentorAgent`.

`public sealed class MentorExcludeAttribute : Attribute`

```shell
dotnet add package Novior.MentorAgent
```

## Constructors

`public MentorExcludeAttribute()`

---

- Previous: [MentorAgentAttribute class](https://docs.mentoragent.net/api/novior-mentoragent-attributes/mentoragentattribute.md)
- Next: [MentorPageAttribute class](https://docs.mentoragent.net/api/novior-mentoragent-attributes/mentorpageattribute.md)
