A [Reference] cannot be stored

The member under [Reference] has a type Bevel cannot store as a key.

  • Error
  • BEVEL052

What it means

A reference must point at a class or record, or at an array or list of them. Value types, strings and dictionaries do not work.

Example message

text
Data/Posts/BlogPost.cs(6,15): error BEVEL052: Dataset 'Posts': [Reference] on 'BlogPost.Author' must reference a class or record type (the referenced item is shared by instance), not 'String'. Help: https://khalidabuhakmeh.github.io/bevel/reference/diagnostics/bevel052/

How to fix

Change the member to the item type of the target dataset, or to a list of it.

csharp
[Reference("Authors")]
public string Author { get; init; }
public Author Author { get; init; }