0
eggersa created
Hello
I got an error after I updated from 0.8.4 to 0.9.1.1 I did not have before:
When I invoke the following method:
public async Task CreateEvent(EventEditDto input)
{
var @event = input.MapTo<Event>();
@event.Attendees = new List<User>();
for (int i = 0; i < input.AttendeeIds.Length; i++)
{
var attendee = await UserManager.FindByIdAsync(input.AttendeeIds[i]);
@event.Attendees.Add(attendee);
}
await _eventRepository.InsertAsync(@event); // exception here
}
I get the error
An entity object cannot be referenced by multiple instances of IEntityChangeTracker.
I get a similar error when I invoke
var entries = ChangeTracker.Entries().ToList();
in my override of ApplyAbpConcepts() in the MyCompanyDbContext class.
The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects.
Obviously there are now multiple DbContexts. How can I handle this properly? Looking forward for your help and thank you in advance ;).