I would like to be able to use the parameter name class for a Blazor component:
<MyComponent class="my-css-class" />
I tried to implement it like this:
<div class="@class">
</div>
@code {
[Parameter]
public string? class { get; set; }
}
However, since class is a reserved keyword in C#, it makes the IDE and compiler confused:
Is it possible somehow to use class as a parameter name?

If you truly wanted to use
classas a property name instead ofClass, then you could escape the reserved keyword in the usual way by prefixing it with an@, and then wrap any references to it in the razor with parentheses.Personally I would just go with C# naming conventions though: