79280709

Date: 2024-12-14 13:42:20
Score: 0.5
Natty:
Report link

After some research I found out that, the QueryTrackingBehavior of Entity Framework was QueryTrackingBehavior.NoTracking which caused problems. After turning the tracking behavior into QueryTrackingBehavior.TrackAll, all problems gone.

services.AddDbContext<AppDbContext>((sp, opt) =>
{
    opt.UseQueryTrackingBehavior(QueryTrackingBehavior.TrackAll);
//...
});
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: user19291301