提交 993b989f 编写于 作者: R Ryan Riley

Merged changes from soma-tests

......@@ -79,6 +79,18 @@
<Reference Include="Simple.Data.SqlServer">
<HintPath>Simple.Data\Simple.Data.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Soma.Core, Version=0.8.0.0, Culture=neutral, PublicKeyToken=bc5ae85929f8312a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Soma\Soma.Core.dll</HintPath>
</Reference>
<Reference Include="Soma.Core.IT.MsSql, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Soma\Soma.Core.IT.MsSql.dll</HintPath>
</Reference>
<Reference Include="Soma.Core.IT.MsSqlCe, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Soma\Soma.Core.IT.MsSqlCe.dll</HintPath>
</Reference>
<Reference Include="SubSonic.Core">
<HintPath>SubSonic\SubSonic.Core.dll</HintPath>
</Reference>
......@@ -196,6 +208,9 @@
<Content Include="OrmLite\ServiceStack.OrmLite.dll" />
<Content Include="OrmLite\ServiceStack.OrmLite.SqlServer.dll" />
<Content Include="OrmLite\ServiceStack.Text.dll" />
<Content Include="Soma\Soma.Core.dll" />
<Content Include="Soma\Soma.Core.IT.MsSql.dll" />
<Content Include="Soma\Soma.Core.IT.MsSqlCe.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="bltoolkit\" />
......
......@@ -68,6 +68,14 @@ static DataClassesDataContext GetL2SContext()
private static Func<EntityFramework.tempdbEntities1, int, EntityFramework.Post> entityFrameworkCompiled = System.Data.Objects.CompiledQuery.Compile<EntityFramework.tempdbEntities1, int, EntityFramework.Post>((db, id) => db.Posts.First(p => p.Id == id));
internal class SomaConfig : Soma.Core.MsSqlConfig
{
public override string ConnectionString
{
get { return Program.connectionString; }
}
}
public void Run(int iterations)
{
var tests = new Tests();
......@@ -164,6 +172,9 @@ public void Run(int iterations)
// IDbCommand ormLiteCmd = Program.GetOpenConnection().CreateCommand();
// tests.Add(id => ormLiteCmd.Select<Post>("select * from Posts where Id = {0}", id), "ServiceStack.OrmLite SQL Query");
// Soma
var somadb = new Soma.Core.Db(new SomaConfig());
tests.Add(id => somadb.Find<Post>(id), "Soma");
// HAND CODED
......
......@@ -4,8 +4,10 @@
namespace SqlMapper
{
[Soma.Core.Table(Name = "Posts")]
class Post
{
[Soma.Core.Id(Soma.Core.IdKind.Identity)]
public int Id { get; set; }
public string Text { get; set; }
public DateTime CreationDate { get; set; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册