I'm new to Entity Framework. :-)
I have something similar to the following:
Master Table
------------------------------------
Id: Name: Detail_id:
1 MasterOne 1
2 MasterTwo 2
Details Table:
------------------------------------
Id: Name: Type:
1 Detail_1 1
2 Detail_2 1
3 Detail_3 2
The Details table has a flag ('Type') that differentiates between the record types.
My Master object looks like this:
public class Master
{
public int ID { get; set; }
public string Name { get; set; }
public virtual IEnumerable<Detail>
Details { get; set; }
}
My Master table needs to load its detail records but ONLY those with a flag of '1'.
My problem is that the IEnumerable Details property pulls in ALL detail records, whereas I need it to only pull in those detail records with a Type flag = 1.
Is this possible?
Thanks!!