void ProcessSet(CollectionMapping mapping)
        {
            var conventions = finder.Find <ISetConvention>();

            Apply <ISetInspector, ISetInstance>(conventions,
                                                new CollectionInstance(mapping));
        }
#pragma warning disable 612,618
        void ProcessArray(CollectionMapping mapping)
        {
            var conventions = finder.Find <IArrayConvention>();

            Apply <IArrayInspector, IArrayInstance>(conventions,
                                                    new CollectionInstance(mapping));
        }
Exemple #3
0
 public void AddCollection(Collections.CollectionMapping collection)
 {
     if (Collections.Any(x => x.Name == collection.Name))
     {
         throw new InvalidOperationException("Tried to add collection '" + collection.Name + "' when already added.");
     }
     AddMapping(collection, MappingType.Collection);
 }
Exemple #4
0
        public void AddCollection(Collections.CollectionMapping collection)
        {
            if (collections.Exists(x => x.Name == collection.Name))
            {
                throw new InvalidOperationException("Tried to add collection '" + collection.Name + "' when already added.");
            }

            collections.Add(collection);
        }
        public override void ProcessCollection(CollectionMapping mapping)
        {
            var generalConventions = finder.Find <ICollectionConvention>();

            Apply <ICollectionInspector, ICollectionInstance>(generalConventions,
                                                              new CollectionInstance(mapping));

            if (mapping.Relationship is ManyToManyMapping)
            {
                var conventions = finder.Find <IHasManyToManyConvention>();

                Apply <IManyToManyCollectionInspector, IManyToManyCollectionInstance>(conventions,
                                                                                      new ManyToManyCollectionInstance(mapping));
            }
            else
            {
                var conventions = finder.Find <IHasManyConvention>();

                Apply <IOneToManyCollectionInspector, IOneToManyCollectionInstance>(conventions,
                                                                                    new OneToManyCollectionInstance(mapping));
            }

            collections[mapping.Collection](mapping);
        }
Exemple #6
0
 public void AddOrReplaceCollection(Collections.CollectionMapping mapping)
 {
     AddOrReplaceMapping(mapping, MappingType.Collection, x => x.Name == mapping.Name);
 }
Exemple #7
0
 public void AddOrReplaceCollection(Collections.CollectionMapping mapping)
 {
     collections.RemoveAll(x => x.Name == mapping.Name);
     collections.Add(mapping);
 }