I need to return a list of newly added objects from my database context.
I have read that i have to use ObjectStateManager for this purpos. The problem
ObjectStateManager
Try this:
dbContext.Entry(entity).State = EntityState.Modified;
var manager = ((IObjectContextAdapter)dbContext).ObjectContext.ObjectStateManager;