• 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.

  • 相关阅读:
    Tp控制器
    thinkphp总体设计
    视频会议管理系统操作步骤(新)
    视频会议(旧)
    HCIE实验LAB_1(1)
    HCIE实验LAB_1(2)
    HCIE实验LAB_1(3)
    HCIE实验LAB_1(4)
    HCIE实验LAB_1(5)
    HCIE实验LAB_1(6)
  • 原文地址:https://www.cnblogs.com/Lulus/p/7877891.html
Copyright © 2020-2023  润新知