用在.NET應用中的SQLite客戶端和ORM:sqlite-net
sqlite-net是一個開源的,非常小的庫用于在.NET 和 Mono 應用中將數存儲至 [http://www.sqlite.org SQLite 3 數據庫]。它采用C#開發,能夠很簡單得編譯至你的項目中。它支持平臺包括Mono for Android, .NET, Silverlight, WP7, WinRT, Azure等。
sqlite-net 設計成一個快捷,方便的數據庫層。它的設計遵循這些目標:
-
Very easy to integrate with existing projects and with MonoTouch projects.
-
Thin wrapper over SQLite and should be fast and efficient. (The library should not be the performance bottleneck of your queries.)
-
Very simple methods for executing CRUD operations and queries safely (using parameters) and for retrieving the results of those query in a strongly typed fashion.
-
Works with your data model without forcing you to change your classes. (Contains a small reflection-driven ORM layer.)
-
0 dependencies aside from a compiled form of the sqlite2 library.
var conn = new SQLiteConnection("foofoo"); var query = conn.Table<Stock>().Where(v => v.Symbol.StartsWith("A")); foreach (var stock in query) Debug.WriteLine("Stock: " + stock.Symbol);