sqlite-net

Generic Repository for SQLite-Net in Xamarin Project

守給你的承諾、 提交于 2019-11-27 17:44:43
I am wondering if there is a way to write a generic repository for my Xamarin project versus writing a different Repository for each entity in my object. The Xamarin Tasky Pro example have one Repository for the Task entity because that is the only entity it has. In my own project I have more than one Entity, so my question is how can I make the following Customer Repository to become generic so that the ProductManager, EmployeeManager, etc can use it. If you know of an example or a blog post please point me to the right direction namespace App.DataLayer { public class CustomerRepository {

Unable to load DLL sqlite3 in Universal Windows App running on Mobile

寵の児 提交于 2019-11-27 14:03:06
I am developing a UWP. I am using the sqlite-net-pcl library. After upgrading my Application from RC to RTM , I got a runtime error - sqlite3.dll could not be found - if it runs on a Mobile emulator or a device. It worked prefectly after I added a reference to C++ 2013 Runtime Package and I ran it in Local Machine. Exception Message: Message "The type initializer for 'SQLitePCL.raw' threw an exception." string The innerexception message: {"Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"} System.Exception {System.DllNotFoundException}

Can I use a List of String in a class intended for SQLite?

十年热恋 提交于 2019-11-27 03:52:50
问题 What limitations are there on data types used in a class that will be used by SQLite-net to represent a table? Specifically, can I use this: public List<string> CoconutWaterBrands { get; set; } ...or will I need this: public string[] CoconutWaterBrands { get; set; } ...or something else altogether? 回答1: ORMs (aka abstraction leak) will have this kind of problem. The fields in the class will correspond to columns in the table. If you use List or arrays then the ORM will either have to somehow

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; }

Generic Repository for SQLite-Net in Xamarin Project

不打扰是莪最后的温柔 提交于 2019-11-26 19:09:33
问题 I am wondering if there is a way to write a generic repository for my Xamarin project versus writing a different Repository for each entity in my object. The Xamarin Tasky Pro example have one Repository for the Task entity because that is the only entity it has. In my own project I have more than one Entity, so my question is how can I make the following Customer Repository to become generic so that the ProductManager, EmployeeManager, etc can use it. If you know of an example or a blog post

Unable to load DLL sqlite3 in Universal Windows App running on Mobile

*爱你&永不变心* 提交于 2019-11-26 16:37:20
问题 I am developing a UWP. I am using the sqlite-net-pcl library. After upgrading my Application from RC to RTM , I got a runtime error - sqlite3.dll could not be found - if it runs on a Mobile emulator or a device. It worked prefectly after I added a reference to C++ 2013 Runtime Package and I ran it in Local Machine. Exception Message: Message "The type initializer for 'SQLitePCL.raw' threw an exception." string The innerexception message: {"Unable to load DLL 'sqlite3': The specified module