私は WinRT アプリに取り組んでいます。、sqlite-net-extensions
をサポートするために使用したい。OneToMany
ManyToMany
using SQLiteNetExtensions.Attributes;
using SQLite;
[Table("WorkFlow")]
public class Workflow
{
[PrimaryKey, AutoIncrement]
public int WorkflowId { get; set; }
public string Name { get; set; }
public int Revision { get; set; }
[OneToMany]
public List<Step> Steps { get; set; }
}
[Table("Step")]
public class Step
{
public string Type { get; set; }
public string Description { get; set; }
[ManyToOne]
public Workflow Workflow { get; set; }
}
データベースのテーブルを生成しようとすると、例外が発生します。
タイプ 'System.NotSupportedException' の例外が app_name.exe で発生しましたが、ユーザー コードで処理されませんでした追加情報: System.Collections.Generic.List`1 [app_name.Model.modelName] について不明です
これは から来ていSqlType
ますSQLite.cs
。
しかし、sqlite-net-extensions
ホームページの例から、List
プロパティは正常に動作するはずです。
これは彼らの例のコピーです:
public class Stock
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
[MaxLength(8)]
public string Symbol { get; set; }
[OneToMany] // 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; }
}
この問題を解決するための提案を誰かに教えてもらえますか? ありがとう。