In this tutorial, you will use the designer's Update Model From Database tool to update the data model automatically.
You need to create the relationship and update the data model so that the Entity Framework can automatically handle this relationship.
In the database diagram, right-click the table, and select Relationships.
In some that includes both business logic and data-access logic.
In this tutorial you will create separate classes for business logic and for data-access logic.
In a production application, you would provide a specific error message when a database constraint prevents a deletion, or you would specify a cascading delete.