zoukankan      html  css  js  c++  java
  • Entity States

    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.

  • 相关阅读:
    SSH整合
    JQuery
    MVC框架与增强
    通用分页(二)
    通用分页(一)
    自定义标签
    反射(一)
    Xml解析作业与Xml建模andXml建模作业
    Xml与Map之间的相互转换
    Xml解析
  • 原文地址:https://www.cnblogs.com/Lulus/p/7877891.html
Copyright © 2011-2022 走看看