Beispiel #1
0
 public Entity(Root root) : base(root)
 {
     Root = root;
     _entities = NestedEntity.CreateSelfManagingCollection(this);
     RegisterEventAppliers()
         .For<RootEvent.Entity.PropertyUpdated.Name>(e => Name = e.Name);
 }
Beispiel #2
0
        public void TestGenerate_NestedEntity()
        {
            var nestedEntity = new NestedEntity
            {
                Key       = "1",
                LeftChild = new NestedEntity
                {
                    Key = "2"
                }
            };
            var records = this.builder.Generate(nestedEntity).ToArray();

            CollectionAssert.AreEquivalent(new[]
            {
                new DbStringRecord("NestedEntity1", "True"),
                new DbStringRecord("NestedEntity1Key", "1"),
                new DbStringRecord("NestedEntity1LeftChild", "2"),
                new DbStringRecord("NestedEntity2", "True"),
                new DbStringRecord("NestedEntity2Key", "2")
            }, records);
        }