c# - collection copy behavior question -


in c#, after add object collection, if copy(deep copy) created?

no, if class, objects are, reference same object stored in collection.

if value type, int, double , structs copy made (not deep copy, if struct has reference class object in turn not copied).

edit:
deep copy objects first need create deep copy function.
have @ create deep copy in c# or how make deep copy in c# ?
can run deep copy method before adding items collection.

note
not need true deep copy. better rethink dataflow in application.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -