Esempio n. 1
0
 public override void QueryTop10(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException();
     }, "SimpleData");
 }
Esempio n. 2
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.FindAll(_db.sfPosts.Id > 5).ToArray();
     }, "SimpleData");
 }
Esempio n. 3
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.Get(5);
     }, "SimpleData dynamic");
 }
Esempio n. 4
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException();
     }, "SimpleData");
 }
Esempio n. 5
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.GetScalar <string>("select title from sfPOsts where id={0}", 5);
     }, Name);
 }
Esempio n. 6
0
 public override void PagedQuery_Skip0_Take10(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.FindAll(_db.sfPosts.Id > 5).Skip(0).Take(10).ToArray();
     }, "SimpleData");
 }
Esempio n. 7
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.GetById <sfPosts>(5);
     }, Name);
 }
Esempio n. 8
0
 public override void QueryTop10(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Query <sfPosts>("select top 10 * from sfposts where id>@0", 5).ToArray();
     }, "SqlFu");
 }
Esempio n. 9
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _cnx.Query <string>("select title from sfPosts where id=@id", new { id = 3 }).Single();
     }, "Dapper scalar");
 }
Esempio n. 10
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.QuerySingle <dynamic>("select * from sfPOsts where id=@id", new{ id = 5 });
     }, Name);
 }
Esempio n. 11
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Query <PostViewModel, IdName>("select p.*,p.Id ,p.title as Name from sfposts p where p.id=@0 order by p.id", 5).FirstOrDefault();
     }, "PetaPoco");
 }
Esempio n. 12
0
 public override void Updates(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Update("sfPosts", "id", new { Id = 3, Title = "updated" });
     }, "PetaPoco");
 }
Esempio n. 13
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Query <dynamic>("select top 10 * from sfPosts where id>@0", 5).ToArray();
     }, "PetaPoco dynamic");
 }
Esempio n. 14
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Single <sfPosts>("select * from sfPosts where id=@0", 5);
     }, "PetaPoco entity");
 }
Esempio n. 15
0
 public override void Updates(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.UpdateById(new { Id = 3, Title = "updated" });
     }, "SimpleData");
 }
Esempio n. 16
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.QuerySingle <PostViewModel>("select *,id as Author_Id,title as Author_Name from sfposts where id=@0 order by id", 5);
     }, "SqlFu");
 }
Esempio n. 17
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.Query <dynamic>("select top 10 * from sfPOsts where id>@id", new { id = 5 });
     }, Name);
 }
Esempio n. 18
0
 public override void PagedQuery_Skip0_Take10(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.PagedQuery <sfPosts>(0, 10, "select * from sfposts where id>@0", 5);
     }, "SqlFu");
 }
Esempio n. 19
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Query <dynamic>("select top 10 * from sfposts where id>@0", 5);
     }, "SqlFu");
 }
Esempio n. 20
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.QueryScalar <string>("select title from sfPOsts where id=@id", new { id = 5 });
     }, Name);
 }
Esempio n. 21
0
 public override void Updates(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Update <sfPosts>(new{ Id = 3, Title = "updated" });
     }, "SqlFu");
 }
Esempio n. 22
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.QuerySingle <dynamic>("select * from sfPosts where id=@0", 5);
     }, "SqlFu dynamic");
 }
Esempio n. 23
0
 public override void PagedQuery_Skip0_Take10(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException("No implicit pagination support");
     }, "Dapper ");
 }
Esempio n. 24
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _cnx.Query <dynamic>("select top 10 Id,AuthorId,Title,CreatedOn,'Post' as Type,TopicId,IsActive from sfPosts where id>@id", new { id = 3 }).ToArray();
     }, "Dapper ");
 }
Esempio n. 25
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _cnx.Query <dynamic>("select Id,AuthorId,Title,CreatedOn,'Post' as Type,TopicId,IsActive from sfPosts where id=@id", new { id = 3 }).FirstOrDefault();
     }, "Dapper query entitty dynamic");
 }
Esempio n. 26
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException();
     }, "SimpleData");
 }
Esempio n. 27
0
 public override void PagedQuery_Skip0_Take10(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.QueryScalar <int>("select count(*) from sfPosts where id >@id", new{ id = 5 });
         _cnx.Select <sfPosts>(s => s.Where(p => p.Id > 5).Limit(0, 10));
     }, Name);
 }
Esempio n. 28
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         //_db.sfPosts.FindById(5).Select(_db["sfPosts"]["Title"]).FirstOrDefault().ToScalar<string>();
         _db.sfPosts.Get(5).ToScalar <int>();
     }, "SimpleData scalar");
 }
Esempio n. 29
0
        public override void Inserts(BenchmarksContainer bc)
        {
            var p = sfPosts.Create();

            bc.Add(d =>
            {
                throw new NotSupportedException("Couldn't figure how to insert pocos with auto increment id");
            }, "massive");
        }
Esempio n. 30
0
        public override void Inserts(BenchmarksContainer bc)
        {
            var p = sfPosts.Create();

            bc.Add(id =>
            {
                _db.Insert(p);
            }, "SqlFu");
        }