METHOD
EntityEntry.Reload
Refreshes tracked values from the database, replacing local edits. An existing row becomes Unchanged; a missing persisted row normally detaches the entry. Reloading an Added entity with no database row is a special case. Requires an appropriate provider.
Formal Syntax & Structure
csharp syntaxcsharp
context.Entry(entity).Reload()Working Example
Example Snippetcsharp
using System;using System.Data;using System.Data.Common;using Microsoft.EntityFrameworkCore;// Partial snippet: existing tracked entity and open context.context.Entry(entity).Reload();