0

In my application I store all data in static list AllData, it inherited from;

public class GenericList<T> : BindingList<T>, IList<T> 

I set user's changes to AllData's selected item and my problem is about cancelling changes. If user cancels changes I retrieve all data from database again. This is not a useful solution; it takes time, creates new db connection etc.

I think that I already have old values before changes. I can backup first values and if user cancels changes, restore backed up values. Problem is coming here; I tried to clone AllData's selected item through ObjectCopier class

public static T Clone<T>(T source)

, and got error like

Type 'Class XYZ' is not marked as serializable.

Yes, I have several serialized classes and the others not serialized. The AllData's selected item what I'm trying to clone, contains all data types what I created.

Should I seralize all classes? If yes; can this cause any problems (security, performance etc.)? or is there any useful method for cancelling operation?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Furkan Ekinci
  • 2,472
  • 3
  • 29
  • 39

0 Answers0