Entity Framework Tutorial Basics(41):Multiple Diagrams
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.
Entity Framework Tutorial Basics(41):Multiple Diagrams的更多相关文章
- Entity Framework Tutorial Basics(1):Introduction
以下系列文章为Entity Framework Turial Basics系列 http://www.entityframeworktutorial.net/EntityFramework5/enti ...
- 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 ...
- Entity Framework Tutorial Basics(43):Download Sample Project
Download Sample Project: Download sample project for basic Entity Framework tutorials. Sample projec ...
- 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 ...
- Entity Framework Tutorial Basics(37):Lazy Loading
Lazy Loading: One of the important functions of Entity Framework is lazy loading. Lazy loading means ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- ACM学习历程—Codeforces Round #354 (Div. 2)
http://codeforces.com/contest/676 在allzysyz学弟和hqwhqwhq的邀请下,打了我的第三场CF... 毕竟在半夜..所以本来想水到12点就去睡觉的...结果一 ...
- winSCP连接FTP没有上传的权限
错误: 原因: ftp用户为 1)查看ubantu中FTP文件夹目录所有者及权限,发现ftpName用户对FTP文件夹的权限为 “r-x” ,仅有读,执行权限 2) chmod o=rwx ftp ...
- Python函数-repr()
repr(object) 作用: repr() 函数将对象转化为供解释器读取的形式. object --对象.返回一个对象的 string 格式. 实例: >>>s = 'RUNOO ...
- 笔记:LIR2032 电池充电记录
笔记:LIR2032 电池充电记录 LIR2032 电池是锂电池,形状和 CR2032 一样,只不过可以充电,材料是锂离子. 一个单颗的 LIR2032 电池容量只有 40mAH,容量很小. 那么就需 ...
- Oracle查询脚本优化
发现生产环境的Oracle数据库cpu使用率上升超过70%,其中一条查询语句达到每秒调用40多次.现在我们来观摩下该语句: select t.id,t.level,t.policy, t.type,t ...
- python中的configparse学习笔记
configparse主要用于在python中进行配置文件的读取. 基本的读取配置文件: -read(filename) 直接读取ini文件内容 -sections() 得到所有的section,并以 ...
- cxGrid使用汇总3
32根据单元的值设置样式 解决:procedure <aForm>.<aColumn>StylesGetContentStyle( Sender: ...
- Linux Samba目录服务搭建与Java客户端访问
前言: 本文比较简略,只求快速入门,若要了解详情,推荐一篇文章:http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html 1,安装sa ...
- java代码水仙花
总结:分离出百位,十位,各位,我总是模模糊糊的,总是分不清取膜与除号的作用区别: “%”的意思是“取膜”,表示取得的是余数 “/”的意思是除,得到的是除数. package com.a; //求水仙花 ...
- Spring Session实现Session共享下的坑与建议
相信用过spring-session做session共享的朋友都很喜欢它的精巧易用-不依赖具体web容器.不需要修改已成项目的代码.笔者在使用spring-session的过程中也对spring-se ...