Exemplo n.º 1
0
        public static EAV.Model.IModelValue Create(EAV.Model.IModelAttribute attribute, EAV.Model.IModelInstance instance)
        {
            ModelValue value = new ModelValue()
            {
                Attribute = attribute,
                Instance  = instance,
            };

            return(value);
        }
Exemplo n.º 2
0
        public static EAV.Model.IModelChildInstance Create(EAV.Model.IModelChildContainer container, EAV.Model.IModelSubject subject, EAV.Model.IModelInstance parentInstance)
        {
            ModelChildInstance instance = new ModelChildInstance()
            {
                ParentInstance = parentInstance,
                Container      = container,
            };

            foreach (ModelAttribute attribute in container.Attributes)
            {
                ModelValue.Create(attribute, instance);
            }

            foreach (ModelChildContainer childContainer in container.ChildContainers)
            {
                ModelChildInstance.Create(childContainer, subject, instance);
            }

            return(instance);
        }