[Process] has the wrong source setting

A member-level [Process] has no source, or a record-level one has one.

  • Error
  • BEVEL087

What it means

A member processor needs a source member. A record processor works on the whole item, so a source makes no sense.

Example message

text
Data/Posts/BlogPost.cs(6,15): error BEVEL087: [Process<MarkdownToHtml>] on 'BlogPost': a type-level processor takes no source member (got 'RawMarkdown'). Use [Process<T>] without arguments on the item type. Help: https://khalidabuhakmeh.github.io/bevel/reference/diagnostics/bevel087/

How to fix

Match the attribute to where you put it.

csharp
public sealed record BlogPost(string Title)
{
    // On a member: name the source.
    [Process<MarkdownToHtml>(nameof(RawMarkdown))]
    public string Html { get; init; } = "";
}

// On the item type: no source.
[Process<DropDrafts>]
public sealed record Page(string Title);