Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Xamarin Forms with Sqlite One to Many Relationship

$
0
0

Hi there, I'm currently making an app that need to store and get data to and from a sqlite database. The two Nudget i'm currently using are Sqlite pcl and SQLite-Net Extensions.

`[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(PatientItem))]
    public string SmartCardID {get;set;}
}`

The whole thing is compile but when I try to run the simulator, I was greet with:

System.NotSupportedException has been thrown
    Don't know about System.Collections.Generic.List1

I checked the SQLite-Net Extensions documentation from this link here and it does support List.
https://bitbucket.org/twincoders/sqlite-net-extensions

Does anyone know how to fix this? Thanks!


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>