Hi.
I'm using a BinaryFormatter
to serialize my object. I have various object types in their relevant lists. Is there a 'best' way to serialize all the objects into one file, but be able to separate them on deserialization? At the moment, I'm deserializing the whole file and checking a specific field in each object to see what list I should re-add them to after deserialization. For example all my Ford cars have the 'FORD' field, Toyota have 'TOYOTA' etc.. Upon deserialization, I 'foreach' through the objects, check their 'company' field and then assign them to a List<Company>
.
I'm not sure if this is the most efficient way of doing things. Any suggestions? Thanks for the help