Once finished a query in the form of List<Entity> I pass it to EntityBase method
Code: Select all
protected BindingList<EntityBase> upCast<T>(List<T> source) where T : EntityBase
{
BindingList<EntityBase> result = new BindingList<EntityBase>() { AllowEdit = true, AllowNew = true, AllowRemove = true, RaiseListChangedEvents = true };
foreach (T t in source)
result.Add(t as EntityBase);
return result;
}
It seems to me that all of them are referenced because, in fact, the binding list is populated with references to evey Entity.
In other words; they could not be garbage collected, so I can go with the default of WeakReference.
Is that true?
TIA