# Change Tracking

**URL:** <https://forum.radzen.com/t/change-tracking/2490>\
**Category:** Blazor Server\
**Created:** [January 30, 2020, 11:07am UTC](https://forum.radzen.com/t/change-tracking/2490 "2020-01-30T11:07:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Pitchford](https://forum.radzen.com/user_avatar/forum.radzen.com/paul_pitchford/32/687_2.png) [@Paul\_Pitchford](https://forum.radzen.com/u/Paul_Pitchford)\
**Post date:** [January 30, 2020, 11:07am UTC](https://forum.radzen.com/t/change-tracking/2490/1 "2020-01-30T11:07:32Z")

</div>

With entity framework, specifically when you're updating data, you have access to the entity details which allows you to view the entity state and also the old values of properties belonging to that entity. (Ref: [https://entityframework.net/knowledge-base/15012621/how-to-get-original-entity-from-changetracker](https://entityframework.net/knowledge-base/15012621/how-to-get-original-entity-from-changetracker))

In Lightswitch we had access to inserting and updating override methods that allowed us to access what I'm referring to so that we could compare values before committing changes to the database. It seems like in Radzen, the only override methods we have access to are updated and created which is too late to catch the old values.

Is there somewhere in the save pipeline (from submitting the form to updating the database) where I can query the entity state and look at the old properties?

Just found this: [Detecting changed properties](http://forum.radzen.com/t/detecting-changed-properties/413/3)

Is this still the advised route to do what I wish?

Thanks,  
Paul.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [January 30, 2020, 11:58am UTC](https://forum.radzen.com/t/change-tracking/2490/2 "2020-01-30T11:58:03Z")

</div>

Hi @Paul_Pitchford,

That answer shows one way to do that. The linked article would also probably work. The partial methods should have access to the EF context which you can use.

---

<div class="post-metadata">

**Author:** ![joshbooker](https://forum.radzen.com/user_avatar/forum.radzen.com/joshbooker/32/12624_2.png) [@joshbooker](https://forum.radzen.com/u/joshbooker)\
**Post date:** [January 30, 2020, 8:28pm UTC](https://forum.radzen.com/t/change-tracking/2490/3 "2020-01-30T20:28:58Z")

</div>

I miss the 'before' and 'after' methods in the save pipeline.  
In LightSwitch we had:

```
CreateFoo(foo) {
    Foo_Creating(foo)
    SaveChanges()
    Foo_Created(foo)
    return foo
}

    UpdateFoo(foo) {
        Foo_Updating(foo)
        SaveChanges()
        Foo_Updated(foo)
        return foo
}

```

Creating, Created, Updating, Updated, Deleting, Deleted were partial methods on every entity so we had full control to extend every step on save pipeline.

That said, in RadZen OnCreated and OnUpdated methods do execute **before** save, I believe.

---

<div class="post-metadata">

**Author:** ![joshbooker](https://forum.radzen.com/user_avatar/forum.radzen.com/joshbooker/32/12624_2.png) [@joshbooker](https://forum.radzen.com/u/joshbooker)\
**Post date:** [April 28, 2021, 6:38pm UTC](https://forum.radzen.com/t/change-tracking/2490/4 "2021-04-28T18:38:33Z")

</div>

save pipline partial methods implented! woot! Thanks @korchev!

> [@On...Updated, On...Created, On...Deleted](http://forum.radzen.com/t/on-updated-on-created-on-deleted/5307/4):
>
> Implemented in the latest Radzen release.
