How does EF Core keeps track of changes?

Поделиться
HTML-код
  • Опубликовано: 6 ноя 2024

Комментарии • 9

  • @donovandemuynck5842
    @donovandemuynck5842 10 месяцев назад

    Excellent explanation, thank you so much

  • @SajidAliSoftwareEngineer
    @SajidAliSoftwareEngineer Год назад +1

    awesome Hubert, it really help me to understand ef change tracker. thank you so much,

  • @dmytrk
    @dmytrk Год назад +1

    Such a good explanation👏

  • @ubongsky1
    @ubongsky1 9 месяцев назад

    Thanks so much for this clarification

  • @Brianle180
    @Brianle180 Год назад

    Great content!

  • @andrw8946
    @andrw8946 Год назад +3

    Can you explain the exact mechanism of how SaveChanges() works for entities with changed properties.
    For example, we have retrieved a Pencil object from the db. And we want to change its quantity from 5 to 10. Then we invoke SaveChanges().
    My question is, how does EF know that the quantity of the previous state was 5 and should update it to 10? Does it keep an image of the db state, of the entity and it compares them?
    For example, if I set the same Pencil objects's quantity from 5 to 5 again and invoke SaveChanges(), will an update command be triggered in SQL?

    • @mateitoderica7892
      @mateitoderica7892 Год назад

      It doesn't MSDN states that it runs an update SQL statement unless the entity has a null PK in which case it inserts.

  • @sergeymigel4680
    @sergeymigel4680 Год назад

    thank you

  • @tanoryjakaperdana1419
    @tanoryjakaperdana1419 Год назад

    thanks sir.. so if i want to update, i need an tracked entity?