次のToJson()メソッドが「{}」のみの文字列を返すという問題があります。
public class GenericRequest
{
public enum SupportedCommands
{
REGISTER, LOGIN, LOGOUT
}
private SupportedCommands command;
private String authentication;
private String password;
private String email;
public GenericRequest(SupportedCommands comm, string aut, string pass, string mail)
{
command = comm;
authentication = aut;
password = pass;
email = mail;
}
virtual public string ToJson()
{
return JsonConvert.SerializeObject(this);
}
}
シリアル化コマンドがクラスのメンバーをシリアル化しない理由がわかりましたか?