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是经过几个版本优化过的产物,性能和功能不断完善,开 ...
随机推荐
- Handler机制原理
andriod提供了Handler 和 Looper 来满足线程间的通信.Handler先进先出原则.Looper类用来管理特定线程内对象之间的消息交换(MessageExchange). 1)Loo ...
- Carrot2 in action 初步印象
RawCluster:聚类中的类别单位 RawCluster.getDocuments():获得该类的文档列表 RawDocument:每个类的文档单位 STC:后缀树表示法 2008-11-13 C ...
- java解析xml字符串为实体(dom4j解析)
package com.smsServer.Dhst; import java.util.HashMap; import java.util.Iterator; import java.util.Ma ...
- IIS配置(持续更新中...)
本文暂时适用于IIS7.5. IIS配置文件路径:"C:\Windows\System32\inetsrv\config\applicationHost.config" 1.sta ...
- Sping Cloud 微服务框架学习
Spring Cloud官方中文站 https://springcloud.cc
- mock数据(模拟后台数据)
mock数据(模拟后台数据) - Emily恩 - 博客园 https://www.cnblogs.com/enboke/p/vue.html Mock.js http://mockjs.com/ 前 ...
- ehcache 配置持久化到硬盘(四)
Ehcache默认配置的话 为了提高效率,所以有一部分缓存是在内存中,然后达到配置的内存对象总量,则才根据策略持久化到硬盘中,这里是有一个问题的,假如系统突然中断运行 那内存中的那些缓存,直接被释放掉 ...
- Java语言实现简单FTP软件------>FTP协议分析(一)
FTP(File Transfer Protocol)就是文件传输协议.通过FTP客户端从远程FTP服务器上拷贝文件到本地计算机称为下载,将本地计算机上的文件复制到远程FTP服务器上称为上传,上传和下 ...
- 斯坦福大学Andrew Ng - 机器学习笔记(3) -- 神经网络模型
大概用了一个月,Andrew Ng老师的机器学习视频断断续续看完了,以下是个人学习笔记,入门级别,权当总结.笔记难免有遗漏和误解,欢迎讨论. 鸣谢:中国海洋大学黄海广博士提供课程视频和个人笔记,在此深 ...
- EasyMock 常见异常
1. java.lang.IllegalStateException: calling verify is not allowed in record state 含义:不允许在记录状态(record ...