public void NotCachedReference() { using (var container = new RhetosTestContainer()) { container.Resolve<ISqlExecuter>().ExecuteSql(new[] {"DELETE FROM TestSqlQueryable.Document;"}); var documentRepository = container.Resolve<Common.DomRepository>().TestSqlQueryable.Document; var doc = new TestSqlQueryable.Document { ID = Guid.NewGuid(), Name = "abc" }; documentRepository.Insert(new[] { doc }); Assert.AreEqual(3, documentRepository.All().Single().Extension_DocumentInfo.NameLen); doc.Name = "abcd"; documentRepository.Update(new[] { doc }); Assert.AreEqual(4, documentRepository.All().Single().Extension_DocumentInfo.NameLen); } }
public void NotCachedReference() { using (var executionContext = new CommonTestExecutionContext()) { executionContext.SqlExecuter.ExecuteSql(new[] {"DELETE FROM TestSqlQueryable.Document;"}); var documentRepository = new Common.DomRepository(executionContext).TestSqlQueryable.Document; var doc = new TestSqlQueryable.Document { ID = Guid.NewGuid(), Name = "abc" }; documentRepository.Insert(new[] { doc }); Assert.AreEqual(3, documentRepository.All().Single().Extension_DocumentInfo.NameLen); doc.Name = "abcd"; documentRepository.Update(new[] { doc }); Assert.AreEqual(4, documentRepository.All().Single().Extension_DocumentInfo.NameLen); } }
public void NotCachedReference() { using (var container = new RhetosTestContainer()) { container.Resolve <ISqlExecuter>().ExecuteSql(new[] { "DELETE FROM TestSqlQueryable.Document;" }); var documentRepository = container.Resolve <Common.DomRepository>().TestSqlQueryable.Document; var doc = new TestSqlQueryable.Document { ID = Guid.NewGuid(), Name = "abc" }; documentRepository.Insert(new[] { doc }); Assert.AreEqual(3, documentRepository.Query().Single().Extension_DocumentInfo.NameLen); doc.Name = "abcd"; documentRepository.Update(new[] { doc }); Assert.AreEqual(4, documentRepository.Query().ToList().Single().Extension_DocumentInfo.NameLen); } }