public async Task Can_read_from_inner_join_with_schema() { if ((Dialect & Dialect.AnyMySql) == Dialect) //ERROR table name too long { return; } db.DropAndCreateTable <ModelWithSchemaAndRowVersionForInnerJoin>(); var rowVersionModel = new ModelWithRowVersion { Text = "test" }; var modelId = await db.InsertAsync(rowVersionModel, selectIdentity : true).ConfigureAwait(false); var innerJoinTable = new ModelWithSchemaAndRowVersionForInnerJoin { ModelWithRowVersionId = modelId, Text = "inner join table" }; var joinId = await db.InsertAsync(innerJoinTable, selectIdentity : true).ConfigureAwait(false); var query = db .From <ModelWithRowVersion, ModelWithSchemaAndRowVersionForInnerJoin>((x, y) => x.Id == y.ModelWithRowVersionId) .Where <ModelWithSchemaAndRowVersionForInnerJoin>(model => model.Id == joinId); var result = await db.SingleAsync(query).ConfigureAwait(false); Assert.NotNull(result); }
public void Can_Save_new_row_and_retrieve_rowversion() { var row = new ModelWithRowVersion { Text = "First" }; bool wasInserted = db.Save(row); Assert.That(wasInserted, Is.True); var actualRow = db.SingleById <ModelWithRowVersion>(row.Id); Assert.That(row.RowVersion, Is.EqualTo(actualRow.RowVersion)); }
public async Task Can_Save_new_row_and_retrieve_rowversion_Async() { var row = new ModelWithRowVersion { Text = "First" }; bool wasInserted = await db.SaveAsync(row); Assert.That(wasInserted, Is.True); var actualRow = await db.SingleByIdAsync <ModelWithRowVersion>(row.Id); Assert.That(row.RowVersion, Is.EqualTo(actualRow.RowVersion)); }
public void Can_Save_new_row_and_retrieve_rowversion() { var row = new ModelWithRowVersion { Text = "First" }; bool wasInserted = db.Save(row); Assert.That(wasInserted, Is.True); var actualRow = db.SingleById<ModelWithRowVersion>(row.Id); Assert.That(row.RowVersion, Is.EqualTo(actualRow.RowVersion)); }