我有这样的表
Id MagNo MagSeason MagYear
1 1 0 2010
2 2 1 2010
3 3 2 2010
4 4 3 2010
MagSeason字段是这样的MagazineDefault ViewModels 中的枚举
public enum Season
{
Spring=0,
Summer=1,
Autumn=2,
Winter=3
}
在杂志的列表视图中我怎么能拥有这个
No Season MagYear
1 Spring 2010
2 Summer 2010
3 Autumn 2010
4 Winter 2010
我这样投
@Html.DisplayFor(modelItem =>(Cinema.ViewModel.Season) int.Parse(item.MagSeason))
但它给出了错误
"Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions."
我在哪里犯错了?
谢谢