Exemple #1
0
 /// <summary>
 /// Adds a new catalog item (associative entity) to the catalog.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="entityStructure">The structure of the entity.</param>
 /// <param name="filename">The name of the file.</param>
 public void Add(Entity entity, EntityStructure entityStructure, string filename)
 {
     if (!EntityCatalogItems.Exists(item => item.Filename.Equals(filename)))
     {
         EntityCatalogItems.Add(new EntityCatalogItem(entity, entityStructure, filename));
     }
 }
Exemple #2
0
 /// <summary>
 /// Adds an <paramref name="entityStructure"/> to the end of this collection, if there is no EntityStructure object
 /// with the same name in the collection.
 /// </summary>
 /// <param name="entityStructure">The EntityStructure object to be added.</param>
 public void Add(EntityStructure entityStructure)
 {
     if (!Structures.Exists(structure => structure.Name == entityStructure.Name))
     {
         Structures.Add(entityStructure);
     }
 }
        /// <summary>
        /// Constructs a new catalog item with the given values.
        /// </summary>
        /// <param name="entity">The name of the associative entity.</param>
        /// <param name="entityStructure">The structure of the entity.</param>
        /// <param name="filename">The name of the file.</param>
        public EntityCatalogItem(Entity entity, EntityStructure entityStructure, string filename)
        {
            EntityName       = entity.Name;
            Filename         = filename;
            PrimaryKeyValues = new Dictionary <string, string>();

            foreach (var key in entityStructure.PrimaryKeys)
            {
                PrimaryKeyValues.Add(key, entity.AttributeValues[key]);
            }
        }