I have a BLB with AddRange and RemoveRange methods, e.g.
public void AddRange(IEnumerable<int> range)
var rlce = RaiseListChangedEvents;
RaiseListChangedEvents = false;
if (range != null)
foreach (var id in range)
RaiseListChangedEvents = rlce;
public void Add(int id)
var account = AccountCreator.GetCreator(id).Result;
The method is called from an MVC controller action. The problem is the range parameter could contain a few thousand ids which makes it very slow with the current implementation. Is there a way to suppress all events, rules during the inserts. I'd want to raise a single list change event at the end of the batch.
Setting RaiseListChangedEvents to false in the AddRange method doesn’t seem to have any effect.
What are my options to improve performance?
Copyright (c) Marimer LLC