I'm trying to understand why the following doesn't work inside of a transaction..
[Test]
public void TestInTransaction_Fails()
{
const string somestringvalue = "SomeStringValue";
TransactionScope scope = null;
try
{
scope = new TransactionScope();
var testObject = new TestObject { SomeInteger = 456, SomeString = somestringvalue };
_client.Cypher
.Create(string.Format("(t:{0} {{newTestObject}})", TestObject.Label))
.WithParam("newTestObject", testObject)
.ExecuteWithoutResults();
var loadedObject = _client.Cypher.Match(string.Format("(t:{0})", TestObject.Label))
.Where((TestObject t) => t.SomeString == somestringvalue)
.Return(t => t.As<TestObject>())
.Results
.FirstOrDefault();
Assert.IsNotNull(loadedObject);
Assert.AreEqual(testObject.SomeString, loadedObject.SomeString);
}
finally
{
if (scope != null)
{
scope.Dispose();
}
}
}