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
Post a Comment