Collection navigation property

We can work out what it actually does from its name, it holds a collection of dependent entities (or references to a list of dependent items) and it always holds references to multiple items. In our blogging system, the Posts property of the Blog entity could be treated as a collection navigation property:

    public class Blog
{
... // code removed for brevity
public ICollection<Post> Posts { get; set; }
}

The Blog and Post class diagrams are displayed as follows. In the design, the highlighted Posts field in the Blog entity would be the collection navigation property:

We have seen the property that holds the child collection; let's explore how the dependent entity holds a reference to its parent in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset