本文整理汇总了C#中CavemanTools.Testing.BenchmarksContainer.Add方法的典型用法代码示例。如果您正苦于以下问题:C# BenchmarksContainer.Add方法的具体用法?C# BenchmarksContainer.Add怎么用?C# BenchmarksContainer.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CavemanTools.Testing.BenchmarksContainer
的用法示例。
在下文中一共展示了BenchmarksContainer.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchSingleEntity
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 [email protected]",5);
},"SqlFu FirstOrDefault");
}
示例2: FetchSingleEntity
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 [email protected]", new { id = 3 }).FirstOrDefault();
}, "Dapper query entity");
}
示例3: FetchSingleDynamicEntity
public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
{
bc.Add(id =>
{
_db.QuerySingle<dynamic>("select * from sfPosts where [email protected]", 5);
}, "SqlFu dynamic");
}
示例4: MultiPocoMapping
public override void MultiPocoMapping(BenchmarksContainer bc)
{
bc.Add(d=>
{
throw new NotSupportedException();
},"Massive");
}
示例5: FetchSingleDynamicEntity
public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
{
bc.Add(d =>
{
_cnx.QuerySql("select * from sfPosts where [email protected]", new { id = 5 }).FirstOrDefault();
}, Name);
}
示例6: ExecuteScalar
public override void ExecuteScalar(BenchmarksContainer bc)
{
bc.Add(d =>
{
_cnx.ExecuteScalarSql<string>("select title from sfPosts where [email protected]", new { id = 5 });
}, Name);
}
示例7: MultiPocoMapping
public override void MultiPocoMapping(BenchmarksContainer bc)
{
bc.Add(id =>
{
_db.IgnoreIfAutoMapFails.Sql("select *,id as Author_Id,title as Author_Name from sfposts where [email protected] order by id", 5).Query<PostViewModel>();
}, Name);
}
示例8: FetchSingleEntity
public override void FetchSingleEntity(BenchmarksContainer bc)
{
bc.Add(d=>
{
_cnx.GetById<sfPosts>(5);
},Name);
}
示例9: QueryTop10Dynamic
public override void QueryTop10Dynamic(BenchmarksContainer bc)
{
bc.Add(id =>
{
_db.Query<dynamic>("select top 10 * from sfPosts where id>@0", 5).ToArray();
}, "PetaPoco dynamic");
}
示例10: MultiPocoMapping
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 [email protected] order by p.id", 5).FirstOrDefault();
}, "PetaPoco");
}
示例11: FetchSingleEntity
public override void FetchSingleEntity(BenchmarksContainer bc)
{
bc.Add(id=>
{
_db.Single<sfPosts>("select * from sfPosts where [email protected]", 5);
},"PetaPoco entity");
}
示例12: MultiPocoMapping
public override void MultiPocoMapping(BenchmarksContainer bc)
{
bc.Add(id =>
{
_db.FirstOrDefault<PostViewModel>("select *,id as Author_Id,title as Author_Name from sfposts where [email protected] order by id",5);
}, "SqlFu");
}
示例13: QueryTop10
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);
}
示例14: FetchSingleEntity
public override void FetchSingleEntity(BenchmarksContainer bc)
{
bc.Add(d=>
{
_cnx.Query<sfPosts>("select * from sfPosts where [email protected]", new {id = 5},commandType:CommandType.Text).FirstOrDefault();
},Name);
}
示例15: FetchSingleDynamicEntity
public override void FetchSingleDynamicEntity(BenchmarksContainer bc)
{
bc.Add(i =>
{
_db.Single(5);
}, "Massive");
}