用在.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);