I'm having difficulty trying to implement the SQLite-Extensions example for Windows Phone 8.1, which is related to OneToMany. I would really like to use this feature, but I pull out my hair, trying to make it work. Like in this question , when I try to use the above example for a stock table that has a list of ratings:
public class Stock { [PrimaryKey, AutoIncrement] public int Id { get; set; } [MaxLength(8)] public string Symbol { get; set; } [OneToMany(CascadeOperations = CascadeOperation.All)] // One to many relationship with Valuation public List<Valuation> Valuations { get; set; } } public class Valuation { [PrimaryKey, AutoIncrement] public int Id { get; set; } [ForeignKey(typeof(Stock))] // Specify the foreign key public int StockId { get; set; } public DateTime Time { get; set; } public decimal Price { get; set; } [ManyToOne] // Many to one relationship with Stock public Stock Stock { get; set; } }
and I try to create a table, I get an error:
An exception of type "System.NotSupportedException" occurred in app_name.exe, but was not processed in the user code. Additional information: I do not know about> System.Collections.Generic.List`1 [application_name .Model.modelName]
I initially included a link to the NuGet package for sqlite-net, as well as SQLiteNetExtensions-PCL, but it was previously mentioned that this is due to the wrong version of the link to sqlite-net.
However, I tried to download the source code for sqlite-net and create it locally, and it does not directly reference SQLiteNetExtensions.
I have included the source locally in my solution, and that does not seem to make any difference. Does anyone have any further suggestions? I have not come across any downloadable example for this.
omnir source share