May 28, 2021 05:08 PM|mgebhard|LINK
You did not follow the recommendation. If you want to keep the same overly complex logic then turn tracking off and add the disconnected entity to the DbContext manually.
Please read the docs.
var countLines = db.Programa_Cor_Info_Status.AsNoTracking().Where(x => x.ID_Programa == iiii).AsNoTracking().Count();
Rather than fetching the count you could simply return a collection of Programa_Cor_Info_Status. Set each item in the collection however you like, then issue one SaveChanges().