You got really stupid code. Read manual before use. 1) use .SaveChanges() only once. 2) use transaction associated with your context: using (var transaction = context.Database.BeginTransaction()) { ... } Period.
NGINX is better
You got really stupid code. Read manual before use.
1) use .SaveChanges() only once.
2) use transaction associated with your context: using (var transaction = context.Database.BeginTransaction()) { ... }
Period.