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. LeetCode Optimal Division

    原题链接在这里:https://leetcode.com/problems/optimal-division/description/ 题目: Given a list of positive int ...

  2. matlab中一些常用的函数

    stem函数h = stem(x,y); %绘制火柴梗图 ,stem的工作原理是,根据一个x对应一个y,绘制火柴梗图.

  3. Yii CDbCriteria类中方法

    $criteria = new CDbCriteria; //select $criteria->select = '*';//默认* $criteria->select = 'id,na ...

  4. Linux 中断下半部

    为什么使用中断下半部? 中断执行的原则是要以最快的速度执行完,而且期间不能延时和休眠! 可是现实中,中断中可能没办法很快的处理完需要做的事,或者必须用到延时和休眠,因此引入了中断下半部. 中断中处理紧 ...

  5. datasnap 上传/下载大文件(本Demo以图传片文件为例)

    好久没写技术文了 datasnap传大流. 完整代码,同时感谢叶兄传流的指点,(只公开十天) 附:下面代码,转载请注明出处 ::code 服务端: function TServerMethods1.D ...

  6. 在laravel中使用QrCode包生成二维码

    http://laravelacademy.org/post/2605.html 一切都是按照文档上的说明操作,没有问题

  7. notifyDataSetChanged() 动态更新ListView

    有时候我们需要修改已经生成的列表,添加或者修改数据,notifyDataSetChanged()可以在修改适配器绑定的数组后,不用重新刷新Activity,通知Activity更新ListView.今 ...

  8. Source Insight中文字体设置

    Source Insight是一个面向项目开发的程序编辑器和代码阅读工具,它拥有内置的对C/C++, C#和Java等程序的分析,分析你的源代 码并在你工作的同时动态维护它自己的符号数据库,并自动为你 ...

  9. Quartz.net 2.x 学习笔记01

    Quartz.net 2.0 2012年4月9日发布了Released版本,到目前(2014-12-08)为止是2.3版 Quartz.net 项目地址:http://www.quartz-sched ...

  10. git 远程仓 和 本地仓 记录

    一.远程仓添加信息后 ,本地环境修改信息后,上传 远程仓 coding=utf-8 本地仓 coding=utf-8 本地仓同步后 会提示存在冲突: (其中 HEAD 是当前非支的意思,可以理解为当前 ...