I've got a class that looks like:
public class Competitor
{
public virtual int CompetitorId { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual IEnumerable<string> SportsCompeted { get; set; }
}
SportsCompeted
is a list of SportIDs (strings) resolved like so:
SELECT DISTINCT SportID FROM results WHERE competitorId = xxx
How would I go about mapping something like that?
Looking at HasMany I can specify a Where
clause, but I don't think that's quite what I'm looking for in this case?
I'm using Fluent Mappings, omitted for brevity.