I can do this:
```csharp
@Html.EditorFor(m => m.Foo, new { htmlAttributes = new { @class = "form-control" } })
```
but I cannot do this:
```csharp
@Html.EditorFor(m => m.Foo, new { htmlAttributes = new Dictionary<string, object> { { "class", "form-control" } } })
```
Even though with the low-level helpers I can do both:
```csharp
@Html.TextBoxFor(m => m.Foo, new { @class = "form-control" })
@Html.TextBoxFor(m => m.Foo, new Dictionary<string, object> { { "class", "form-control" } })
```
Comments: @attilah What I meant is that you can use an anonymous object instead and your data-* attributes will get renamed from using underscores to using dashes.
```csharp
@Html.EditorFor(m => m.Foo, new { htmlAttributes = new { @class = "form-control" } })
```
but I cannot do this:
```csharp
@Html.EditorFor(m => m.Foo, new { htmlAttributes = new Dictionary<string, object> { { "class", "form-control" } } })
```
Even though with the low-level helpers I can do both:
```csharp
@Html.TextBoxFor(m => m.Foo, new { @class = "form-control" })
@Html.TextBoxFor(m => m.Foo, new Dictionary<string, object> { { "class", "form-control" } })
```
Comments: @attilah What I meant is that you can use an anonymous object instead and your data-* attributes will get renamed from using underscores to using dashes.