我目前正在製作一個應用程序,需要存儲和從sqlite數據庫獲取數據。我目前使用的兩個Nuget包是Sqlite PCL
和SQLite-Net Extensions
。Sqlite一對多關係
[Table("patient")]
public class Patient
{
[PrimaryKey]
public string ID { get; set;}
public string FirstName { get; set; }
public string LastName { get; set; }
[OneToMany]
public List<PatientVitals> PatientVitals { get; set; }
}
[Table("patientVitals")]
public class PatientVitals
{
[PrimaryKey]
public string VitalID {get;set;}
public string Weight { get; set;}
public string Height { get; set;}
[ForeignKey(typeof(Patient))]
public string SmartCardID {get;set;}
}
整個事情被編譯很好,但是當我嘗試運行我得到這個消息的模擬器:
System.NotSupportedException已經扔不知道System.Collections中 .Generic.List1
我檢查了SQLite-Net Extensions documentation,它支持List。
有誰知道如何解決這個問題?
不起作用,得到相同的消息。但是,謝謝! – Fayt
我瘦了,他們正在修復(或工作)修復List <>問題。 [link](https://bitbucket.org/twincoders/sqlite-net-extensions/pull-requests/12/support-ilist-instead-of-list-as-enclosed/diff#comment-8587796) – Roman