public class Myviewmodel { public int PublicProperty { get; set; } internal int InternalProperty { get; set; } }
.
@*My view*@ @model Myviewmodel @Model.PublicProperty @Model.InternalProperty @*Causes compilation error*@
结论:始终只在视图模型上使用公共属性.