public void AddsEntityToDatabase_ReturnsGeneratedPrimaryKeyForDynamic() { var d1 = new Dyno { Name = "Dyno" }; Db.Insert(d1); Assert.IsInstanceOf(typeof(Int32), d1.Id); Assert.True(d1.Id > 0); }
public void Issue182_BindDynamicObjectParametersAndColumns() { connection.Execute("create table #Dyno ([Id] uniqueidentifier primary key, [Name] nvarchar(50) not null, [Foo] bigint not null);"); var guid = Guid.NewGuid(); var orig = new Dyno { Name = "T Rex", Id = guid, Foo = 123L }; var result = connection.Execute("insert into #Dyno ([Id], [Name], [Foo]) values (@Id, @Name, @Foo);", orig); var fromDb = connection.Query <Dyno>("select * from #Dyno where Id=@Id", orig).Single(); ((Guid)fromDb.Id).IsEqualTo(guid); fromDb.Name.IsEqualTo("T Rex"); ((long)fromDb.Foo).IsEqualTo(123L); }
private void Start() { dyno = GameManager.Instance.Dyno; sfx = GameManager.Instance.sfx; }