我有一個實體,所謂的「競爭」使用公式來映射的IEnumerable字符串
競賽中,我有一個屬性:
IEnumerable<string> EventCodes {get;set;}
我想要做的,是一個子查詢時從我的映射文件映射此 摘錄:
public CompetitionMap()
{
Id(x => x.Id);
Map(x => x.DisciplineCodes)
.Formula("(SELECT DISTINCT DisciplineCode
from tblSomeOtherTable WHERE EventID = [ID])");
Table("tblCompetitions");
}
然而,這是引發此錯誤:
{"Could not determine type for: System.Collections.Generic.IEnumerable`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, for columns: NHibernate.Mapping.Formula((SELECT DISTINCT EventCode from tblSomeOtherTable WHERE EventID = [ID]))"}
值得一提的是tblSomeOtherTable沒有被映射,也不會被映射。
我錯過了什麼?