H
Herby
I have a class like the following:
using namespace System::Collections::Generics;
[Serializable]
public ref class StringMap : public Dictionary<String^, String^>
{
public:
};
But when deserializing, the framework throws an exception that no
default constructor could be found for class StringMap.
If i then modify the class to the following:
[Serializable]
public ref class StringMap
{
public:
protected:
Dictionary<String^, String^> mMap;
};
then de-serializes ok. But I do not want a HAS_A relationship, for me
its more expressive to represent as a IS_A relationship. Also it would
be faster as no indirection.
Why will not the IS_A verison de-serialize correctly?
Thanks in advance.
};
using namespace System::Collections::Generics;
[Serializable]
public ref class StringMap : public Dictionary<String^, String^>
{
public:
};
But when deserializing, the framework throws an exception that no
default constructor could be found for class StringMap.
If i then modify the class to the following:
[Serializable]
public ref class StringMap
{
public:
protected:
Dictionary<String^, String^> mMap;
};
then de-serializes ok. But I do not want a HAS_A relationship, for me
its more expressive to represent as a IS_A relationship. Also it would
be faster as no indirection.
Why will not the IS_A verison de-serialize correctly?
Thanks in advance.
};