Example #1
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(id=>
                {
                    _db.Get<sfPosts>(5);
                },"SqlFu Get");
     bc.Add(id=>
                {
                    _db.QuerySingle<sfPosts>("select * from sfPosts where id=@0",5);
                },"SqlFu FirstOrDefault");
 }
Example #2
0
        public override void FetchSingleEntity(BenchmarksContainer bc)
        {
            bc.Add(id =>
                {
                    _cnx.Get<sfPosts>(3);
                    
                  }, "Dapper get entity");

            bc.Add(id =>
            {
                _cnx.Query<sfPosts>("select Id,AuthorId,Title,CreatedOn,'Post' as Type,TopicId,IsActive from sfPosts where id=@id", new { id = 3 }).FirstOrDefault();

            }, "Dapper query entity");
        }
Example #3
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.QuerySingle<dynamic>("select * from sfPosts where id=@0", 5);
     }, "SqlFu dynamic");
 }
Example #4
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(d=>
                {
                    throw new NotSupportedException();
                },"Massive");
 }
Example #5
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.QuerySql("select * from sfPosts where id=@id", new { id = 5 }).FirstOrDefault();
     }, Name);
 }
Example #6
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.ExecuteScalarSql<string>("select title from sfPosts where id=@id", new { id = 5 });
     }, Name);
 }
Example #7
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.IgnoreIfAutoMapFails.Sql("select *,id as Author_Id,title as Author_Name from sfposts where id=@0 order by id", 5).Query<PostViewModel>();
     }, Name);
 }
Example #8
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(d=>
         {
             _cnx.GetById<sfPosts>(5);
         },Name);
 }
Example #9
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");
 }
Example #10
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");
 }
Example #11
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
    bc.Add(id=>
               {
                   _db.Single<sfPosts>("select * from sfPosts where id=@0", 5);
               },"PetaPoco entity");
 }
Example #12
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.FirstOrDefault<PostViewModel>("select *,id as Author_Id,title as Author_Name from sfposts where id=@0 order by id",5);
     }, "SqlFu");
 }
Example #13
0
 public override void QueryTop10(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.Query<sfPosts>("select top 10 * from sfPosts where id>@id", new { id = 5 }, commandType: CommandType.Text).ToArray();
     }, Name);
 }
Example #14
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(d=>
                {
                    _cnx.Query<sfPosts>("select * from sfPosts where id=@id", new {id = 5},commandType:CommandType.Text).FirstOrDefault();
                },Name);
 }
Example #15
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(i =>
                {
                    _db.Single(5);
                }, "Massive");
 }
Example #16
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");
 }
Example #17
0
 public override void QueryTop10(BenchmarksContainer bc)
 {
     bc.Add(i =>
                {
                    throw new NotSupportedException("not explicit type support");
                }, "Massive");
 }
Example #18
0
 public override void QueryTop10(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.Query<sfPosts>("select top 10 * from sfPOsts where id>@id", new { id = 5 });                
     }, Name);
 }
Example #19
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(i =>
         {
         Enumerable.ToArray(_db.Paged(pageSize: 10).Items);
     }, "Massive");
 }
Example #20
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.QuerySql("select top 10 * from sfPosts where id>@id", new { id = 5 }).ToArray();
     }, Name);
 }
Example #21
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(i=>
                {
                    _db.Scalar("select title from sfPosts where id=@0", 5);
                },"Massive");
 }
Example #22
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.QuerySql<PostViewModel, IdName>("select *, Id, title as Name from sfposts p where id=@id order by p.id", new { id = 5 });
     }, Name);
 }
Example #23
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.Query<dynamic>("select top 10 * from sfposts where id>@0", 5);
     }, "SqlFu");
 }
Example #24
0
 public override void MultiPocoMapping(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         throw new NotSupportedException();
     }, "SimpleData");
 }
Example #25
0
 public override void ExecuteScalar(BenchmarksContainer bc)
 {
     bc.Add(d =>
     {
         _cnx.ExecuteScalar<int>("select authorid from sfPosts where id=@id", new { id = 5 }, commandType: CommandType.Text);
     }, Name);
 }
Example #26
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");
 }
Example #27
0
 public override void QueryTop10Dynamic(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.FindAll(_db.sfPosts.Id>5).ToArray();
     }, "SimpleData");
 }
Example #28
0
 public override void QueryTop10(BenchmarksContainer bc)
 {
     bc.Add(id=>
                {
                    throw new NotSupportedException();
                }, "SimpleData");
 }
Example #29
0
 public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
 {
     bc.Add(id =>
     {
         _db.sfPosts.Get(5);
     }, "SimpleData dynamic");
 }
Example #30
0
 public override void FetchSingleEntity(BenchmarksContainer bc)
 {
     bc.Add(id=>
                {
                    throw new NotSupportedException();
                },"SimpleData");
     
 }