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

后端 未结 5 1139
梦毁少年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:54

    Thanks for the replies. It would be nice to be able to force classes derived from an interface to implement serialization without this then forcing them to custom serialize but it doesn't seem to be possible.

提交回复
热议问题