相关疑难解决方法(0)

Sqlite扩展无法按预期工作

我正在开发一个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; }
}
Run Code Online (Sandbox Code Playgroud)

当我尝试为数据库生成表时,它会引发异常:

app_name.exe中出现"System.NotSupportedException"类型的异常但未在用户代码中处理其他信息:不了解System.Collections.Generic.List`1 [app_name.Model.modelName]

这来自 …

c# windows-runtime windows-store-apps sqlite-net sqlite-net-extensions

10
推荐指数
2
解决办法
4630
查看次数

如何创建集合(1:n)关系

我正在Windows Store应用程序(WinRT)中实现SQLite数据库.我想要两个表之间的关系(1:n)书(1) - 章(n)

class Book
{
    [SQLite.AutoIncrement, SQLite.PrimaryKey]
    public int Id { get; set; }
    public String Title { get; set; }
    public String Description { get; set; }
    public String Author { get; set; }
    public List<Chapter> Chapters { get; set; }

    public Book() 
    {
        this.Chapeters = new List<Chapter>();
    }
}
Run Code Online (Sandbox Code Playgroud)

我明白了

-       $exception  {"Don't know about     System.Collections.Generic.List`1[Audioteka.Models.Chapter]"}    System.Exception {System.NotSupportedException}

+       [System.NotSupportedException]  {"Don't know about System.Collections.Generic.List`1[Audioteka.Models.Chapter]"}    System.NotSupportedException

+       Data    {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
    HelpLink    null    string
    HResult -2146233067 int …
Run Code Online (Sandbox Code Playgroud)

c# sqlite microsoft-metro windows-runtime windows-store-apps

7
推荐指数
2
解决办法
6383
查看次数