Exemple #1
0
 public override void QueryTop10(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException();
     }, "SimpleData");
 }
Exemple #2
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.FindAll(_db.sfPosts.Id > 5).ToArray();
     }, "SimpleData");
 }
Exemple #3
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.Get(5);
     }, "SimpleData dynamic");
 }
Exemple #4
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException();
     }, "SimpleData");
 }
Exemple #5
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.GetScalar <string>("select title from sfPOsts where id={0}", 5);
     }, Name);
 }
Exemple #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");
 }
Exemple #7
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.GetById <sfPosts>(5);
     }, Name);
 }
Exemple #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");
 }
Exemple #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");
 }
Exemple #10
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.QuerySingle <dynamic>("select * from sfPOsts where id=@id", new{ id = 5 });
     }, Name);
 }
Exemple #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");
 }
Exemple #12
0
 public override void Updates(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Update("sfPosts", "id", new { Id = 3, Title = "updated" });
     }, "PetaPoco");
 }
Exemple #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");
 }
Exemple #14
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Single <sfPosts>("select * from sfPosts where id=@0", 5);
     }, "PetaPoco entity");
 }
Exemple #15
0
 public override void Updates(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.UpdateById(new { Id = 3, Title = "updated" });
     }, "SimpleData");
 }
Exemple #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");
 }
Exemple #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);
 }
Exemple #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");
 }
Exemple #19
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Query <dynamic>("select top 10 * from sfposts where id>@0", 5);
     }, "SqlFu");
 }
Exemple #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);
 }
Exemple #21
0
 public override void Updates(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Update <sfPosts>(new{ Id = 3, Title = "updated" });
     }, "SqlFu");
 }
Exemple #22
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.QuerySingle <dynamic>("select * from sfPosts where id=@0", 5);
     }, "SqlFu dynamic");
 }
Exemple #23
0
 public override void PagedQuery_Skip0_Take10(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException("No implicit pagination support");
     }, "Dapper ");
 }
Exemple #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 ");
 }
Exemple #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");
 }
Exemple #26
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException();
     }, "SimpleData");
 }
Exemple #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);
 }
Exemple #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");
 }
Exemple #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");
        }
Exemple #30
0
        public override void Inserts(BenchmarksContainer bc)
        {
            var p = sfPosts.Create();

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