I have a model property that is declared as type List<MyClass>
.
public class MyModel
{
List<MyClass> MyProperty { get; set; }
}
I want to be able to display/edit the property using Razor templates. My question is, how I name an EditorTemplate view so that I can display the property using the normal syntax:
@model MyModel
@Html.DisplayFor(m => m.MyProperty)
I know that I can create a view called MyClass.cshtml that will be used for the type MyClass
, but how do I create a template for the list?