What is the difference between Add vs Attach vs Update in detached scenarios?

Updated Apr 28, 2026

Short answer

These methods define how the ChangeTracker treats an untracked entity graph (e.g., data coming from an API request).

Deep explanation

Add() marks the entire graph (parent and children) as 'Added' (INSERT). Attach() marks the entire graph as 'Unchanged' (no DB update) unless property changes are detected manually. Update() marks the entire graph as 'Modified' (UPDATE), forcing EF to overwrite every column in the DB, even if unchanged.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Entity Framework interview questions

View all →