Ejemplo n.º 1
0
        public void Add(ConfiguredObjectFactory objectFactory)
        {
            ThrowIfConflictingItemExists(
                objectFactory,
                _objectFactories,
                (of1, of2) => $"An object factory for type {of1.ObjectTypeName} has already been configured");

            ObjectFactories.AddOrReplaceThenSort(objectFactory);
        }
Ejemplo n.º 2
0
        public void Add(ConfiguredObjectFactory objectFactory)
        {
            ThrowIfConflictingItemExists(
                objectFactory,
                _objectFactories,
                (factory, conflictingFactory) => string.Format(
                    CultureInfo.InvariantCulture,
                    "{0} factory for type {1} has already been configured",
                    conflictingFactory.IsMappingFactory() ? "A mapping" : "An object",
                    factory.ObjectType.GetFriendlyName()));

            if (objectFactory.ObjectType.IsSimple())
            {
                HasSimpleTypeValueFactories = true;
            }

            if (objectFactory.IsMappingFactory())
            {
                HasMappingFactories = true;
            }

            ObjectFactories.AddOrReplaceThenSort(objectFactory);
        }
Ejemplo n.º 3
0
 public void Add(ConfiguredObjectFactory objectFactory) => _objectFactories.Add(objectFactory);