Yes, you're instantiating EntityCollection
, and not EntityCollection<CustomerEntity>()
which is what the model expects.
You can just replace new EntityCollection(new CustomerEntityFactory())
with new EntityCollection<CustomerEntity>();
(assuming you didn't change any behavior in the CustomerEntityFactory)
Additionally, you should fetch the entity with a Predicate, this is not doing anything at the moment when you're using the adapter model:
var customerEntity = new CustomerEntity(1);
and this will just fetch all the customers in the database:
adapter.FetchEntityCollection(customerEntityColl,null);