---
title: "Accessing Objects Just After they are Saved by Entity Framework"
url: https://daily.dev/posts/accessing-objects-just-after-they-are-saved-by-entity-framework-xfonyfbzq
source_url: https://nodogmablog.bryanhogan.net/2023/04/accessing-objects-just-after-they-are-saved-by-entity-framework
type: article
source: "No Dogma Blog (Bryan Hogan)"
published: 2026-05-31T07:46:56.644Z
updated: 2026-05-31T08:44:28.482Z
tags: [".net", "c#"]
reading_time: 3
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Accessing Objects Just After they are Saved by Entity Framework

**[No Dogma Blog \(Bryan Hogan\)](https://daily.dev/sources/bryanhogan)** · 3 min read · 0 upvotes · 0 comments

## Summary

A practical guide showing how to access entities immediately after they are saved by Entity Framework, with their primary keys already assigned. The technique involves overriding `SaveChangesAsync` in a custom `DbContext`, storing the result of the base save call, then using the `ChangeTracker` to retrieve the saved entities filtered by type using LINQ. This is useful for post-save notifications or any logic that requires the newly assigned primary key.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nodogmablog.bryanhogan.net/2023/04/accessing-objects-just-after-they-are-saved-by-entity-framework>

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/accessing-objects-just-after-they-are-saved-by-entity-framework-xfonyfbzq)
