我尝试使用Html.EnumDropDownFor(model => model.Gender)
,这只适用于模型Project.Models.Performer
,但不适用于IEnumerable<Project.Models.Performer>
。
在Visual Studio中,我收到以下错误:
"The type arguments for method Html.SelectExtensions.EnumDropDownLostFor<TModel, TEnum>(...) cannot be inferred from the usage. Try specifying the the arguments explicitly"
在浏览器中我得到:
"CS1061: 'System.Collections.Generic.IEnumerable<Project.Models.Performer>' does not contain a definition for 'Gender' and no extension method 'Gender' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Project.Models.Performer>' could be found (are you missing a using directive or an assembly reference?)"
Gender
是我在Performer的文件中定义的枚举。