2013年6月3日 星期一

Entity Framework–Model First, Part 4 (Diagram & Color)

We are able to separate all entities into several diagrams, it is no such limitation to put all in one model design diagram.

First, open Model Browser by VIEW –> Other Windows –> Entity Data Model Browser

image

Add a new diagram named Product, and add 2 entities Product and Category by follow the steps in this blog

image

Switch to previous diagram, Diagram1, Add a new Association

image

In this window, we can also see Product & Category entities even they are not belong to this diagram

image

After that, we see Product navigation property has been added into Order

image

Order has been added into Product as well, but different diagram

image

 

In the meanwhile, we can change the color of entity by changing its Fill Color property to other color

image

The result will be look like this if we change to red color

image

 

Let’s see what happen if we Generate Database from Model… again with new add diagram and association in the model

image

Obviously, the script drop all existing Foreign Key constraints and all existing Tables

image

沒有留言:

張貼留言