Can’t auto-generate IDENTITY with AddRange in Entity Framework
What was causing the problem? Enumerables! Take a look at the EDIT section in my question for the solution. EDIT: posting the updated code here as answer. The problem was in the way I used enumerables. Bottom line is you should never trust lazy loading when you need consistent results right away. public class Request … Read more