小编Hot*_*max的帖子

如何将我的 TextEditor > C# > 代码样式设置重置为默认值或 VS 2019 中的早期版本?

它们似乎没有在 vssettings 等中导出。我没有找到将它们恢复到早期版本甚至默认的现成 Visual Studio 设置的方法...

恢复所有设置也没有帮助。

c# code-formatting visual-studio

6
推荐指数
0
解决办法
926
查看次数

SQLiteAsyncConnection.InsertAsync(obj) 未返回正确的键

我们在 Xamarin.Forms 应用程序中使用 SQLite 数据库来将业务对象保留在模型层中。

  • 使用的 nuget 包:
    • SQLiteNet扩展,
    • SQLiteNetExtensions.Async [2.1.0]
    • sqlite-net-pcl [1.5.231])

业务对象看起来像

[SQLite.Table(nameof(MyBo))]
class MyBo
{
    [PrimaryKey, AutoIncrement]
    public int ID { get; set; }
    public string Name { get; set; }

    ... etc
}
Run Code Online (Sandbox Code Playgroud)

呼唤

int id1 = conn.InsertAsync(new MyBo(){ ID = 0, Name ="Foo" });
int id2 = conn.InsertAsync(new MyBo(){ ID = 0, Name ="Bar" });
Run Code Online (Sandbox Code Playgroud)

将导致id1 = 1id2 = 1

conn.Table<T>().ToListAsync()返回具有正确 ID(1 和 2)的对象。

我错过了什么,我期望 InsertAsync 调用返回正确的值,但它总是返回 1!?

sqlite-net xamarin.forms

1
推荐指数
1
解决办法
2636
查看次数