I am working on an existing project inwhich cancelling the changes to an entity was never wired up in our base form. Our base form has a MainObect which is an EntityBase and we also have a hashtable containing the related child entities we are also able to edit on this form.
I would like to somehow cast the objects in the hashtable to something Generic that I can then call the Refetch method on without knowning the specific instance of the collection class.
I wish I could cast an Object to EntityCollectionBase(of EnitityBase) but this is not in the hierachy. If this was possible I could the check if the collection has changes and if it does then refetch the entity if it is dirty or remove it from the collection if it is new.
Any suggestions on finding a common class that I can cast the related child entities object to would be great. If I refecth the main object it only refetchs the main object and not the related entities.
We are using self service and Net 2.0 of llblgen.
A later version would create a clone of the mainobject and its child entities and then just swap it out on Cancel.