王胜龙的博客

OrmLite

  • OrmLite-性能对比

    测试环境:系统:Windows 10 企业版CPU:AMD Athlon(tm) II X4 641 Quad-Core Processor 2.80 GHzMem:8.00 GBDB:SqlSe…

  • OrmLite-起步

    一、 引入Loogn.OrmLitePM Install-Package Loogn.OrmLite二、引入名称空间using Loogn.OrmLite; 三、开始使用using (var db …

  • OrmLite-模型

    一个纯净的Model public class Person{public int Id { get; set; }public string Name { get; set; }public Da…

  • OrmLite-插入

    使用model插入,返回影响行数 var person = new Person { Name = "loogn" };var flag = db.Insert(person); 使用model插入,…

  • OrmLite-修改

    根据主键修改model,返回影响行数var person = new Person { Id = 23, Name = "update name", Age = 28 };var flag = db.…

  • OrmLite-查询1

    根据id查询一条数据var person=db.SingleByIdPerson (1);orvar person=db.SingleByIdPerson (1,"_id"); 根据条件查询一条数据v…

  • OrmLite-查询2

    查询数量long count = db.CountPerson (); select count(0) from Person;long count = db.CountPerson ("id @id…

  • OrmLite-删除

    根据id删除var flag = db.DeleteByIdPerson (2); delete from person where id=2;var flag = db.DeleteByIdPers…

  • OrmLite-其他

    执行存储过程db.Proc("sp_name", DictBuilder.Assign("p1", 21).Assign("p2", "p2 value"),true); 直接执行var cmd = …