thanks for the reply...
I originally had my code using Coroutine.StartParallel(LoadLists, Action<CompletedEventArgs>), but changed it to test if it does make a deference... which it doesn't...
the issue here is this function is called once when the class is instantiated.
so the first instance, it runs with no issues... on the subsequent instances, the completed event does not fire..
eg:
var x = new Class(); <- the method is called and successfully invoke the completed event
var x1 = new Class(); <- the method is called but completed event does not fire
the only deference between the first instance and all others, is the data is returned from cache for all other instances...
even if the data are returned from cache, shouldn't completed event fire anyway?
below is the LoadLists method.
IEnumerable<INotifyCompleted> LoadLists() { yield return _repository.GlobalManager.Products.Where(col => col.IsActive) .ExecuteAsync(opt => { if (opt.CompletedSuccessfully) { _manager.ImportEntities(opt.Results, MergeStrategy.OverwriteChanges); } });
yield return _repository.GlobalManager.ProductSuppliers .ExecuteAsync(opt => { if (opt.CompletedSuccessfully) { _manager.ImportEntities(opt.Results, MergeStrategy.OverwriteChanges); } }); yield return _repository.GlobalManager.Contacts .Where(col => col.IsActive && col.ContactType == ContactTypeEnum.SUPPLIER.ToString()) .ExecuteAsync(opt => { if (opt.CompletedSuccessfully) { _manager.ImportEntities(opt.Results, MergeStrategy.OverwriteChanges); } }); }
|
Edited by sarmaad - 03-Nov-2010 at 8:36pm