Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

SQLite.net: create a table for a complex class

$
0
0

Hi,

Can SQLite.net handle the following:

public class MyClass
{
    public int Id { get; set; }
    public string Name { get; set; }
    public virtual ICollection<MyOtherClass> MyOtherClassList { get; set; } // <<< This is the problematic part
}

SQLiteConnection.CreateTable<MyClass>();

Running this code as is throws an exception saying SQLite isn't familiar with the type MyOtherClass. This happens in the part of the code where it tries to map properties to basic types SQLite.cs::public static string SqlType (TableMapping.Column p, bool storeDateTimeAsTicks)

Is there a correct way to achieve this or do I have to separate the classes and use foreign keys?

Thanks, Eyal


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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