Multiple Diagrams in Entity Framework 5.0

Visual Studio 2012 provides a facility to split the design time visual representation of the Entity Data Model. This means that you can have multiple diagrams for one Entity Data Model.

You can create a new diagram in multiple ways:

  1. Add a new diagram and drag and drop entities from Model Browser
  2. Move entities from an existing diagram to a new diagram

1. Add a new diagram and drag and drop entities from Model Browser:

You can add a new diagram by right clicking on the Diagrams node of the model browser and selecting 'Add New Diagram':

You can rename the diagram, for example: StudentDiagram to include all student related entities:

Now, you can drag and drop Student and StudentAddress entities to this new diagram:

2. Move entities from existing diagram to new diagram:

You can also move entities from an existing diagram to a new diagram. For example, if you want to move Teacher and Course entities to a new diagram, then select those entities in an existing diagram and right click and select 'Move to New Diagram' from the context menu:

It will create a new diagram and move Teacher and Course entities to a new diagram as shown below:

So, in this way you can create a new diagram from an existing diagram.

You can also include the related entities of a particular entity. For example, right click on Student entity → select 'Include Related'. Standard and Course entities will also be included, because Student has their reference property:

This will include Standard and Course entity as shown below.

Additionally, you can also move properties up or down by right clicking on the property → select Move Property → select UP/Down etc. as shown below:

Difference between delete and remove entity:

You can remove the entity from the diagram by right clicking on entity and selecting 'Remove from diagram'.

Remove from Diagram will only remove the entity from the diagram whereas 'Delete from Model' will delete the entity from the EDM. So you won't be able to use that entity at all.

Entity Framework Tutorial Basics(41):Multiple Diagrams的更多相关文章

  1. Entity Framework Tutorial Basics(1):Introduction

    以下系列文章为Entity Framework Turial Basics系列 http://www.entityframeworktutorial.net/EntityFramework5/enti ...

  2. Entity Framework Tutorial Basics(4):Setup Entity Framework Environment

    Setup Entity Framework Environment: Entity Framework 5.0 API was distributed in two places, in NuGet ...

  3. Entity Framework Tutorial Basics(43):Download Sample Project

    Download Sample Project: Download sample project for basic Entity Framework tutorials. Sample projec ...

  4. Entity Framework Tutorial Basics(42):Colored Entity

    Colored Entity in Entity Framework 5.0 You can change the color of an entity in the designer so that ...

  5. Entity Framework Tutorial Basics(37):Lazy Loading

    Lazy Loading: One of the important functions of Entity Framework is lazy loading. Lazy loading means ...

  6. Entity Framework Tutorial Basics(36):Eager Loading

    Eager Loading: Eager loading is the process whereby a query for one type of entity also loads relate ...

  7. Entity Framework Tutorial Basics(34):Table-Valued Function

    Table-Valued Function in Entity Framework 5.0 Entity Framework 5.0 supports Table-valued functions o ...

  8. Entity Framework Tutorial Basics(33):Spatial Data type support in Entity Framework 5.0

    Spatial Data type support in Entity Framework 5.0 MS SQL Server 2008 introduced two spatial data typ ...

  9. Entity Framework Tutorial Basics(32):Enum Support

    Enum in Entity Framework: You can now have an Enum in Entity Framework 5.0 onwards. EF 5 should targ ...

随机推荐

  1. python RabbitMQ队列使用

    python RabbitMQ队列使用 关于python的queue介绍 关于python的队列,内置的有两种,一种是线程queue,另一种是进程queue,但是这两种queue都是只能在同一个进程下 ...

  2. goreplay(gor) golang 流量拷贝工具试用

    1. 项目地址 https://github.com/buger/goreplay 2. 安装 wget https://github.com/buger/goreplay/releases/down ...

  3. Windows 7 中的 God Mode

    Windows 7系统中隐藏了一个秘密的“God Mode”,字面上译为“上帝模式”,但似乎叫它“万能模式”更贴切一些.God Mode其实就是一个简单的文件夹窗口,但包含了几乎所有Windows 7 ...

  4. bzoj 3796 Mushroom追妹纸——后缀数组

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3796 长度一般都是 1e5 ,看这个是 5e4 ,一看就是把两个串接起来做. 自己本来想的是 ...

  5. bzoj 4278 [ONTAK2015]Tasowanie——后缀数组

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4278 因为每次要放后缀较小的那个,所以把两个序列放在一起排序吧.改一改模板. 其实要改的地方 ...

  6. 第17篇 shell编程基础(2)

    shell study 1.Exit StatusIf the command executed successfully (or true), the value of $? is zero. If ...

  7. flume采集log4j日志到kafka

    简单测试项目: 1.新建Java项目结构如下: 测试类FlumeTest代码如下: package com.demo.flume; import org.apache.log4j.Logger; pu ...

  8. Difference between boot ip. service ip and persistent ip in hacmp

    - boot IP is the original address on a network interface even when the cluster is down - service IP ...

  9. nextSibling VS nextElementSibling

    2. nextSibling vs nextElementSibling { //FF { 在Firefox中,link2的nextSibling并不是link3,因为两者之间有一个换行符. 这被认为 ...

  10. (转)WebApi 上传文件

    本文转载自:http://www.cnblogs.com/zj1111184556/p/3494502.html public class FileUploadController : ApiCont ...