예제 #1
0
        public void Poco_with_lazy1_can_be_written()
        {
            var a = new Lazypoco {
                Name = "foo"
            };
            var Da = _sx.Save(a);

            var b = new Lazypoco {
                Name = "bar", Parent = new Lazy <Lazypoco>(() => a)
            };
            var Db = _sx.Save(b);

            var c = _sx2.Load <Lazypoco>(Db.Id);

            Assert.That(a.Name, Is.EqualTo(c.Parent.Value.Name));
        }
		public void Poco_with_lazy1_can_be_written()
		{
			var a = new Lazypoco { Name = "foo" }; 
			var Da = _sx.Save(a);
			
			var b = new Lazypoco { Name = "bar", Parent = new Lazy<Lazypoco>(() => a) };
			var Db = _sx.Save(b);
			
			var c = _sx2.Load<Lazypoco>(Db.Id);
			Assert.That(a.Name, Is.EqualTo(c.Parent.Value.Name));
		}