コード例 #1
0
 public EntityDescription(string id, string name, string nameSpace, string description, OrmObjectsDef ormObjectsDef, EntityDescription baseEntity, EntityBehaviuor behaviour)
 {
     _id                   = id;
     _name                 = name;
     _description          = description;
     _tables               = new List <TableDescription>();
     _properties           = new List <PropertyDescription>();
     _suppressedProperties = new List <PropertyDescription>();
     _ormObjectsDef        = ormObjectsDef;
     _namespace            = nameSpace;
     _baseEntity           = baseEntity;
     _behaviour            = behaviour;
 }
コード例 #2
0
        public EntityDefinition(string id, string name, string @namespace, string description,
                                WXMLModel model, EntityDefinition baseEntity, EntityBehaviuor behaviour)
        {
            _id                     = id;
            _name                   = name;
            _description            = description;
            _sourceFragments        = new List <SourceFragmentRefDefinition>();
            _properties             = new List <PropertyDefinition>();
            _suppressedProperties   = new List <string>();
            _model                  = model;
            EntitySpecificNamespace = @namespace;
            _baseEntity             = baseEntity;
            Behaviour               = behaviour;

            if (model != null && !model.GetEntities().Any(item => item.Identifier == id))
            {
                model.AddEntity(this);
            }

            Interfaces = new Dictionary <string, TypeDefinition>();
        }
コード例 #3
0
ファイル: OrmXmlParser.cs プロジェクト: AlexeyShirshov/oml
        internal protected void FindEntities()
        {
            XmlNodeList entitiesList;

            entitiesList = _ormXmlDocument.DocumentElement.SelectNodes(string.Format("{0}:Entities/{0}:Entity", OrmObjectsDef.NS_PREFIX), _nsMgr);

            EntityDescription entity;

            _ormObjectsDef.Entities.Clear();

            foreach (XmlNode entityNode in entitiesList)
            {
                string          id, name, description, nameSpace, behaviourName;
                EntityBehaviuor behaviour = EntityBehaviuor.Default;

                XmlElement entityElement = (XmlElement)entityNode;
                id            = entityElement.GetAttribute("id");
                name          = entityElement.GetAttribute("name");
                description   = entityElement.GetAttribute("description");
                nameSpace     = entityElement.GetAttribute("namespace");
                behaviourName = entityElement.GetAttribute("behaviour");

                if (!string.IsNullOrEmpty(behaviourName))
                {
                    behaviour = (EntityBehaviuor)Enum.Parse(typeof(EntityBehaviuor), behaviourName);
                }


                entity           = new EntityDescription(id, name, nameSpace, description, _ormObjectsDef);
                entity.Behaviour = behaviour;

                _ormObjectsDef.Entities.Add(entity);

                FillEntityTables(entity);
            }
        }