Two datasets collide on a property name

Two datasets produce the same C# property name, or one clashes with a built-in member.

  • Error
  • BEVEL053

What it means

Each dataset becomes a property on the generated data class. Names are cleaned up into C# identifiers, and two different datasets can end up with the same one. Names like ToString also clash with object.

Example message

text
Data/Posts/BlogPost.cs(6,15): error BEVEL053: Dataset 'blog-posts' and dataset 'BlogPosts' both map to the C# property 'BlogPosts'. Rename one dataset, e.g. [DataSource("MyData2", ...)] or Name => "MyData2" on a loader. Help: https://khalidabuhakmeh.github.io/bevel/reference/diagnostics/bevel053/

How to fix

Rename one dataset so its C# name is different. Avoid names that match members of object, like Equals or GetType.