I have an entity, called "Competition"
In Competition, I have a property:
IEnumerable<string> EventCodes {get;set;}
What I'm trying to do, is a subselect when mapping this Excerpt from my mapping file:
public CompetitionMap()
{
Id(x => x.Id);
Map(x => x.DisciplineCodes)
.Formula("(SELECT DISTINCT DisciplineCode
from tblSomeOtherTable WHERE EventID = [ID])");
Table("tblCompetitions");
}
However, this is throwing this error:
{"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]) )"}
It's worth mentioning that tblSomeOtherTable isn't mapped, nor will it be.
What have I missed?