我的项目像这样反序列化json数据:
{
"NonCashFunds": [
{
"companyId": "51ed67a3-7220-11df-b336-0011955cba6b",
"relevanceDate": "2015/04/30",
"amount": "951755,87"
}
],
MainPage_NonCashFund类:
public class MainPage_NonCashFund : INotifyPropertyChanged
{
private string companyId { get; set; }
public string CompanyId
{
get { return companyId; }
set
{
if (companyId != value)
{
companyId = value;
OnPropertyChanged("CompanyId");
}
}
}
... RelevanceDate... Amount...
}
和MainPageInfo类:
[Table("MainPageInfo")]
public class MainPageInfo
{
public MainPage_NonCashFund[] NonCashFunds { get; set; }
}
反锯齿化效果很好:
MainPageInfo mainPageInfo = JsonConvert.DeserializeObject<MainPageInfo>(result.ToString(), new CustomDateTimeConverter());
但是当我尝试将mainPageInfo对象实例保存到sqlite表中(使用InsertOrReplace方法)时,我看到错误消息:
Don't know about NonCashFunds[]
是否可以将该对象保存到sqlite数据库中?保存简单的类效果很好。
谢谢。