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.

EntityFramework 学习 一 Multiple Diagrams in Entity Framework 5.0的更多相关文章

  1. EntityFramework 学习 一 Table-Valued Function in Entity Framework 5.0

    USE [SchoolDB] GO /****** Object: UserDefinedFunction [dbo].[GetCourseListByStudentID] */ SET ANSI_N ...

  2. EntityFramework 学习 一 Change Tracking in Entity Framework

    EntityFramework自动跟踪上下文中已经加载的实体,DbChangeTracker类给你关于当前实体的所有跟踪信息 注意,每个实体都要有EntityKey(主键)的属性,EntityFram ...

  3. EntityFramework 学习 一 Migration from Entity Framework 4.1/4.3 to Entity Framework 5.0/6.0

    To migrate your existing Entity Framework 4.x project to Entity Framework 5.0 using VS2012, first ta ...

  4. .NET 5学习笔记(10)——Entity Framework Core之切换SQLServer和SQLite

    上一篇我们梳理了CodeFist的一般流程,本篇我们讨论如何在一套代码中,支持SQL Server和SQLite的切换.同时从本篇开始,我们从.NET Core 3.1 迁移到.NET 5.相信.NE ...

  5. Entity Framework 5.0系列之Code First数据库迁移

    我们知道无论是"Database First"还是"Model First"当模型发生改变了都可以通过Visual Studio设计视图进行更新,那么对于Cod ...

  6. 浅析Entity Framework Core2.0的日志记录与动态查询条件

    前言 Entity Framework Core 2.0更新也已经有一段时间了,园子里也有不少的文章.. 本文主要是浅析一下Entity Framework Core2.0的日志记录与动态查询条件 去 ...

  7. Entity Framework 6.0 对枚举的支持/实体添加后会有主键反回

    实验 直接上代码,看结果 实体类 [Flags] public enum FlagsEnum { Day = , Night = } public class EntityWithEnum { pub ...

  8. Entity Framework 6.0 Tutorials(1):Introduction

    以下系统文章为EF6.0知识的介绍,本章是第一篇 原文地址:http://www.entityframeworktutorial.net/entityframework6/introduction.a ...

  9. Entity Framework 6.0 入门系列 第一篇

    Entity Framework 6.0 入门系列 第一篇 好几年前接触过一些ef感觉不是很好用,废弃.但是 Entity Framework 6.0是经过几个版本优化过的产物,性能和功能不断完善,开 ...

随机推荐

  1. 【Cocos游戏实战】功夫小子第八课之游戏打包和相关问题说明

    至此,功夫小子系列的Cocos2d-x的实战文章就结束了. 源代码地址: https://github.com/SuooL/KungfuBoy 如须要资源请邮件我 1020935219@qq.com ...

  2. phpstorm将多个int数字拼接成字符串

    场景:将程序输出的多个int数字拼成以','分隔的字符串 数据为 8680 24399 37619 45425 49635 139334 386918 429498 461616 523384 561 ...

  3. CodeIgniter框架——数据库类(配置+快速入门)

    CodeIgniter用户指南——数据库类 数据库配置 入门:用法举例 连接数据库 查询 生成查询结果 查询辅助函数 Active Record 类 事务 表格元数据 字段元数据 自定义函数调用 查询 ...

  4. 服务器http请求https服务时报错解决方案

    问题一. 问题二. java.security.KeyException 解决: Java.security.KeyException的解决 程序调用环信的接口时,出现此异常. 环境:centos , ...

  5. js验证表单大全3

    2 >表单提交验证类  2.1 表单项不能为空 <scriptlanguage="javascript"> <!-- function CheckForm( ...

  6. MySQL中锁问题

    1.脏读 脏页只是在缓冲池中已经修改的页但是没有刷新到磁盘中,即数据库实例内存中的页和磁盘中的页事不一致的,当然在刷新到磁盘之前,日志都已经被写入到了重做日志文件中,而所谓的脏数据是指事务对缓冲池中行 ...

  7. android自定义View (五)view.requestLayout() 与 invalidate()

    一.要点 If in the course of processing the event, the view's bounds may need to be changed, the view wi ...

  8. SpringBoot入门1—简介及helloworld

    Spring Boot简介 Spring Boot让我们的Spring应用变的更轻量化.比如:你可以仅仅依靠一个Java类来运行一个Spring引用.你也可以打包你的应用为jar并通过使用java - ...

  9. Python基础-常用的内置函数

    内置函数filter str = ['a', 'b', 'c', 'd'] def fansik(num): if num != "a": return num ret = fil ...

  10. NPOI 导入 导出

    using NPOI.XSSF.UserModel;   using System.IO; 导入 /// <summary> /// Excel转换DataTable /// </s ...