Beispiel #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");
 }
Beispiel #2
0
        public void create_if_exists_ignore()
        {
            Table.ExecuteDDL();
            Db.Insert(TableName, new { Name = "aha", Uid = Guid.NewGuid() });
            var ddl = Db.DatabaseTools.GetCreateTableBuilder(TableName, IfTableExists.Ignore);

            ddl.Columns.Add("sid", DbType.Int32);
            Assert.DoesNotThrow(() => ddl.ExecuteDDL());
            var cnt = Db.QuerySingle <dynamic>("select * from " + Db.Provider.EscapeName(TableName));

            Assert.Equal("aha", cnt.Name);
        }