EntityFramework 学习 一 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:
- Add a new diagram and drag and drop entities from Model Browser
- 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的更多相关文章
- EntityFramework 学习 一 Table-Valued Function in Entity Framework 5.0
USE [SchoolDB] GO /****** Object: UserDefinedFunction [dbo].[GetCourseListByStudentID] */ SET ANSI_N ...
- EntityFramework 学习 一 Change Tracking in Entity Framework
EntityFramework自动跟踪上下文中已经加载的实体,DbChangeTracker类给你关于当前实体的所有跟踪信息 注意,每个实体都要有EntityKey(主键)的属性,EntityFram ...
- 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 ...
- .NET 5学习笔记(10)——Entity Framework Core之切换SQLServer和SQLite
上一篇我们梳理了CodeFist的一般流程,本篇我们讨论如何在一套代码中,支持SQL Server和SQLite的切换.同时从本篇开始,我们从.NET Core 3.1 迁移到.NET 5.相信.NE ...
- Entity Framework 5.0系列之Code First数据库迁移
我们知道无论是"Database First"还是"Model First"当模型发生改变了都可以通过Visual Studio设计视图进行更新,那么对于Cod ...
- 浅析Entity Framework Core2.0的日志记录与动态查询条件
前言 Entity Framework Core 2.0更新也已经有一段时间了,园子里也有不少的文章.. 本文主要是浅析一下Entity Framework Core2.0的日志记录与动态查询条件 去 ...
- Entity Framework 6.0 对枚举的支持/实体添加后会有主键反回
实验 直接上代码,看结果 实体类 [Flags] public enum FlagsEnum { Day = , Night = } public class EntityWithEnum { pub ...
- Entity Framework 6.0 Tutorials(1):Introduction
以下系统文章为EF6.0知识的介绍,本章是第一篇 原文地址:http://www.entityframeworktutorial.net/entityframework6/introduction.a ...
- Entity Framework 6.0 入门系列 第一篇
Entity Framework 6.0 入门系列 第一篇 好几年前接触过一些ef感觉不是很好用,废弃.但是 Entity Framework 6.0是经过几个版本优化过的产物,性能和功能不断完善,开 ...
随机推荐
- Netdata安装和使用(Linux 性能实时监测工具)
Netdata 是一款 Linux 性能实时监测工具..以web的可视化方式展示系统及应用程序的实时运行状态(包括cpu.内存.硬盘输入/输出.网络等linux性能的数据). Netdata文档地址: ...
- jqGrid单元格编辑配置,事件及方法
转自 http://blog.csdn.net/xueshijun666/article/details/18151055 // var ret = $("#in_store_list_de ...
- POJ3487[稳定婚姻]
The Stable Marriage Problem Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2974 Accepted ...
- 3673: 可持久化并查集 by zky
3673: 可持久化并查集 by zky Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 2170 Solved: 978[Submit][Status ...
- (八)solr7实现搜索框的自动提示并统计词频
solr7实现搜索框的自动提示并统计词频 1:用solr 的suggest组件,统计词频相对麻烦. 2:用TermsComponent,自带词频统计功能. Terms组件提供访问索引项的字段和每个词 ...
- iOS RunLoop详解
1. RunLoop简介 1.1 什么是RUnLoop 可以理解为字面的意思:Run表示运行,Loop表示循环.结合在一起就是运行的循环.通常叫做运行循环. RunLoop实际上是一个对象,这个对象在 ...
- 微信小程序-学习总结(1)
微信小程序尺寸单位 rpx单位是微信小程序中css的尺寸单位,rpx可以根据屏幕宽度进行自适应.规定屏幕宽为750rpx. 设备 rpx换算成px(屏幕宽度/750) ...
- Qt Creator 如何支持并行?
PRO 文件中加入以下语句即可 #OpenMP QMAKE_CXXFLAGS += -openmp QMAKE_LFLAGS += -openmp
- jdbc PreparedStatement 防止sql注入的关键代码片段
mysql-connector-java-5.1.38.jar PreparedStatement 的 setString(int parameterIndex, String x) 方法 for ( ...
- 常用代码块:java使用系统浏览器打开url
方法一:用于windows try { Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+url) ...