I have two classes:
public class Parent
{
public virtual string Name { get; set; }
public virtual string Family_id { get; set; }
}
public class Children
{
public virtual string Name { get; set; }
public virtual DateTime BirthDate { get; set; }
public virtual string Family_id { get; set; }
}
When I take a parent, I also want to get the oldest (ordered by BirthDate) children who have the same Family_id as the parent.
There is no foreign key between the parent and children in the database.
(I do not want to use two different repositories, I want functionality in the mappings)
Is property-ref something I can use?
source
share