Is it possible to create a property / function in my datacontroller that creates en returns a entitycollection dynamically given a specific Entitytype ?
var custumers = MyEntityCollection<EntityTypes.CustomerEntity>();
new we have in the datacontroller the following code for each entity:
private EntityCollection<UsersEntity> mUsers;
public EntityCollection<UsersEntity> Users {
get { return mUsers; }
set { mUsers = value; }
}
IEntityCollection2 collection (Users == null) ? new EntityCollection<UsersEntity>() : Users;
if (entityCollection != null) {
entityCollection.Clear();
using (DataAccessAdapter adapter = DataAccessAdapter.CreateInstance()) {
adapter.FetchEntityCollection(entityCollection, Filter, 0, sorter, prefetchPath);
}
}
Users = collection;