sqlite-net-extensions

Use SQLiteNetextensions with Xamarin for Android-App

≯℡__Kan透↙ 提交于 2019-12-08 04:20:04
问题 I've read some threads about SQLite for Xamarin but I'm still not able to set up SQLiteNetExtensions in a proper way. I'm currently developing an android app with Target Framework Android 7.1(API Level 25 - Nougat). Can anybody tell me what I'm doing wrong? I installed nuget packages: Install-Package SQLiteNetExtensions -Version 2.0.0-alpha2 -Pre Install-Package SQLite.Net-PCL -Version 3.1.1 According to: https://bitbucket.org/twincoders/sqlite-net-extensions Then I set up my code. using

Windows Phone 8.1 Sqlite-net foreign key relationship

百般思念 提交于 2019-12-08 04:05:37
问题 I have installed sqlite-net from NuGet package in my windows phone universal app. But it does not contain foreign key relationship attribute between tables. I searched the web and found that SQLITE-Net Extenstions can handle this by using attributes, But it can only be installed on Windows 8.1 app not on windows Phone 8.1. How can use this extension in windows phone 8.1 or is there any other solution for foreign key relationships in sqlite? Thanks! 回答1: There exists a PCL version of this

ManyToOne constraint not working

牧云@^-^@ 提交于 2019-12-07 18:07:27
I have very simple relationship, my model looks like this: public class Project { [PrimaryKey, AutoIncrement] public int ID { get; set; } public string Name { get; set; } [ForeignKey(typeof(User))] public int ProjectManagerID { get; set; } [ManyToOne] public User ProjectManager { get; set; } } public class User { public string Login { get; set; } [OneToMany] public List<Project> Projects { get; set; } } The problem is that I can easly save project, with its reference to user without saving user, and I don't get any constraint violation exception. database.Insert(new Project { Name = "aaa",

Use SQLiteNetextensions with Xamarin for Android-App

不问归期 提交于 2019-12-07 09:50:31
I've read some threads about SQLite for Xamarin but I'm still not able to set up SQLiteNetExtensions in a proper way. I'm currently developing an android app with Target Framework Android 7.1(API Level 25 - Nougat). Can anybody tell me what I'm doing wrong? I installed nuget packages: Install-Package SQLiteNetExtensions -Version 2.0.0-alpha2 -Pre Install-Package SQLite.Net-PCL -Version 3.1.1 According to: https://bitbucket.org/twincoders/sqlite-net-extensions Then I set up my code. using SQLite.Net.Attributes; using SQLiteNetExtensions.Attributes; using System; namespace AppName.Resources

Windows Phone 8.1 Sqlite-net foreign key relationship

拥有回忆 提交于 2019-12-06 14:58:00
I have installed sqlite-net from NuGet package in my windows phone universal app. But it does not contain foreign key relationship attribute between tables. I searched the web and found that SQLITE-Net Extenstions can handle this by using attributes, But it can only be installed on Windows 8.1 app not on windows Phone 8.1. How can use this extension in windows phone 8.1 or is there any other solution for foreign key relationships in sqlite? Thanks! There exists a PCL version of this library. If you install via NuGet, you might see this error You can solve this by cloning the repository as

How to use SQLite-Net Extensions with Composite keys

拜拜、爱过 提交于 2019-12-02 23:08:16
问题 I have the following class: Class1.cs: [JsonObject(MemberSerialization.OptIn)] public class Class1 { [PrimaryKey] [JsonProperty("key1")] public string Key1 { get; set; } [PrimaryKey] [JsonProperty("key2")] public string Key2 { get; set; } [PrimaryKey] [JsonProperty("key3")] public string Key3 { get; set; } [JsonProperty("normalStuff")] public string NormalStuff{ get; set; } [OneToMany(CascadeOperations = CascadeOperation.All)] [JsonProperty("customObjectList")] public List<CustomObject>

SQLite-Net Extension both one-to-one and one-to-many relationships between two entities

被刻印的时光 ゝ 提交于 2019-11-30 09:30:23
I am using SQLite-Net PCL together with SQLite-Net extensions for the development of an application using Xamarin. In my model I have two entities, let us call them A and B, that are connected by both a one-to-one and a one-to-many relationships. For instance, A has a one-to-one relationship with B, and A has also a one-to-many relationship with B. Is it possible to express such behaviour with SQLite-Net extensions? Yes, but you have to explicitly declare the foreign keys and inverse properties in the relationship attribute, because otherwise the library may get the wrong foreign key for the

SQLite-Net Extension both one-to-one and one-to-many relationships between two entities

女生的网名这么多〃 提交于 2019-11-29 14:33:01
问题 I am using SQLite-Net PCL together with SQLite-Net extensions for the development of an application using Xamarin. In my model I have two entities, let us call them A and B, that are connected by both a one-to-one and a one-to-many relationships. For instance, A has a one-to-one relationship with B, and A has also a one-to-many relationship with B. Is it possible to express such behaviour with SQLite-Net extensions? 回答1: Yes, but you have to explicitly declare the foreign keys and inverse

Sqlite extension is not working as expected

天涯浪子 提交于 2019-11-28 10:05:38
I am working on an WinRT app. I want to use sqlite-net-extensions to support 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; } } When I try to generate the tables for the database, it

Sqlite extension is not working as expected

戏子无情 提交于 2019-11-27 03:23:27
问题 I am working on an WinRT app. I want to use sqlite-net-extensions to support 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; }