【发布时间】:2014-08-30 17:58:40
【问题描述】:
我尝试了几乎所有的解决方案,但没有用。我无法获得特定列优先级的不同列表。非常感谢任何帮助。
public List<AlertType> GetAllAlertNames()
{
var lstAlertNames = _zyenaDbContext.AlertTypes.Select(x => x.Priority).Distinct().ToList();
return lstAlertNames;
}
返回 lstAlertNames 时出现以下错误:
cannot implicitly convert type 'system.collections.generic.list string '
to 'system.collections.generic.list zyenaEntities.AlertType
在模型警报类型中
public string Priority { get; set; }
【问题讨论】:
标签: entity-framework asp.net-mvc-4