Beispiel #1
0
        protected override void Initialize()
        {
            var child1 = new ListChild {
                Name = "child1"
            };
            var parent = new ListParent {
                Children = new List <ListChild> {
                    child1
                }
            };

            //Revision 1
            using (var tx = Session.BeginTransaction())
            {
                parentId = (Guid)Session.Save(parent);
                tx.Commit();
            }

            //Revision 2
            using (var tx = Session.BeginTransaction())
            {
                child1.Name = "child12";
                tx.Commit();
            }

            //Revision 3
            using (var tx = Session.BeginTransaction())
            {
                Session.Delete(parent);
                tx.Commit();
            }
        }
Beispiel #2
0
        protected override IParent CreateParent(int numberOfChildren)
        {
            var parent = new ListParent();

            for (var i = 0; i < numberOfChildren; i++)
            {
                parent.Children.Add(new Child {
                    Name = "child" + i
                });
            }
            return(parent);
        }
Beispiel #3
0
        public void GetParent()
        {
            ModuleFactory _factory = new ModuleFactory();
            var           data     = _factory.GetParent();

            foreach (ModuleModels item in data)
            {
                ListParent.Add(new SelectListItem
                {
                    Value = item.Id,
                    Text  = item.Name
                });
            }
        }