博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Entity States
阅读量:7121 次
发布时间:2019-06-28

本文共 865 字,大约阅读时间需要 2 分钟。

Added. The entity does not yet exist in the database. The SaveChanges method must issue an INSERT statement.

Unchanged. Nothing needs to be done with this entity by the SaveChanges method. When you read an entity from the database, the entity starts out with this status.
Modified. Some or all of the entity's property values have been modified. The SaveChanges method must issue an UPDATE statement.
Deleted. The entity has been marked for deletion. The SaveChanges method must issue a DELETE statement.
Detached. The entity isn't being tracked by the database context.(分离状态:实体没有被数据上下文跟踪)
Entity states让SaveChanges()方法可以确定命令内容
For example, when you pass a new entity to the Add method, that entity's state is set to Added. Then when you call the SaveChanges method, the database context issues a SQL INSERT command.

转载于:https://www.cnblogs.com/Lulus/p/7877891.html

你可能感兴趣的文章
windows应用迁移到linux下
查看>>
linux网卡研究
查看>>
考虑用静态工厂方法代替构造器
查看>>
常见排序算法:冒泡排序
查看>>
我的友情链接
查看>>
使用ZooKeeper
查看>>
Jenkins+git 实现代码自动发布
查看>>
【转】frame与bounds的区别比较
查看>>
从今天开始写博文
查看>>
Java并发 乐观锁和悲观锁 乐观锁的一种实现方式CAS
查看>>
SpringMVC json/xml自动转换
查看>>
我的友情链接
查看>>
lua 语言基础
查看>>
[shell] IT运维之Linux服务器监控方案
查看>>
也谈如何构建高性能服务端程序
查看>>
linux 下 安装 node.js 详细步骤
查看>>
Python第二天(字典)
查看>>
form表单回车提交问题,JS监听回车事件
查看>>
我的友情链接
查看>>
一个U盘走天下,装机大神撩妹的不二之选
查看>>