我有一个我已经编辑过的网络服务,在它正常工作之前。但是现在我收到此错误:无法序列化,因为它没有无参数构造函数我在下面发布了我的类。
public class Class
{
public class AnsweredQ
{
public string Question { get; set; }
public string Answer { get; set; }
public AnsweredQ(string _Question, string _Answer)
{
Question = _Question;
Answer = _Answer;
}
}
public class UnAnsweredQ
{
public string Question { get; set; }
public string[] Options { get; set; }
public UnAnsweredQ(string _Question, string[] _Options)
{
Question = _Question;
Options = _Options;
}
}
public class Trial
{
public string User { get; set; }
public DateTime TrialDate { get; set; }
public bool Expired { get; set; }
public Trial (string _User, DateTime _TrialDate, bool _Expired)
{
User = _User;
TrialDate = _TrialDate;
Expired = _Expired;
}
}
}
如果你能解决这个问题,请解释我做错了什么:)