mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-26 02:30:00 +08:00
Merged changes from soma-tests
This commit is contained in:
@@ -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 @@ namespace SqlMapper
|
||||
|
||||
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 @@ r& number, NumberFormatInfo info, Boolean parseDecimal)
|
||||
// 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 @@ using System.Reflection;
|
||||
|
||||
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; }
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user