Enforcing serializable from an interface without forcing classes to custom serialize in C#

后端 未结 5 1140
梦毁少年i
梦毁少年i 2021-02-19 23:00

I have an interface that defines some methods I would like certain classes to implement.

public interface IMyInterface
{
    MethodA;
    MethodB;
}

Additi

5条回答
  •  情话喂你
    2021-02-19 23:45

    Write a class that implements ISerializationSurrogate and use that to serialize classes that aren't serializable or where you're not sure of the serialization implementation.

提交回复
热议问题