If you're fetching entities using a linq query, you can do:
var customers = ((ILLBLGenProQuery)q).Execute<EntityCollection<CustomerEntity>>();
This will return the result in an EntityCollection<T>
, in this case EntityCollection<CustomerEntity>
. There's also an Async variant.
If you don't want to do this, and have a List<T>, you can do:
var results = myLinqQuery.ToList();
var resultsAsEntityCollection = new EntityCollection<CustomerEntity>();
resultsAsEntityCollection.AddRange(results);
//...
Your code looks like it should save the entities properly though, but if they're not changed/marked as dirty then nothing will be done with them, perhaps that's it? If the entities are in a collection, they are also saved in a loop unless you enabled batching.