I'm wondering if I can use virtual properties defines in a base class (abstract) to create a link with an other concrete type.
For example :
public abstract class AbstractService
{
public int Id {get;set;}
public int? SiteId {get;set;}
public virtual Site Site {get;set;}
}
public class StudyTeamService : AbstractService
{
public int? RoleId {get;set;}
public virtual Role Role {get;set;}
}
public abstract class AbstractSite
{
public int Id {get;set;}
public string Name {get;set;}
}
public class Site : AbstractSite
{
public virtual ICollection<StudyTeamService> StudyTeamServices {get;set;}
}
I presume I have to add an annotation on the ICollection so that it know how to map correctly, but I can't find the correct one.
Do you guys have any idea ?
Seems that if I set [InverseProperty("Site")] on the ICollection, it crash with an error telling that the relation is not defined in the assembly...