Unidirectional One-to-Many Associations in Entity Framework 4?
- by Eric J.
Does EF 4 support unidirectional one-to-many associations, as in:
public class Parent
{
public int Id { get; set; }
public string Something { get; set; }
public List<Child> AllMyChildren { get; set; }
}
public class Child
{
public int Id { get; set; }
public string Anotherthing { get; set; }
// I don't want a back-reference to the Parent!
// public int ParentId { get; set; }
}
When I try to compile my project with an association between Parent and Child where End2 Navigation is blank (because I unchecked the End2 Navigation Property checkbox in the Add Association dialog), I get
Error 2027: No mapping specified for the following EntitySet/AssociationSet - Child.