public void Add <TKey>(object extended, TKey key, IExtensionAttribute func)
        {
            Type type = extended.GetType();

            if (dictionary.TryGetValue(type, out IAttributeMap map))
            {
                map.Add(extended, key, func);
            }
            else
            {
                IAttributeMap nested = factory();
                dictionary.Add(type, nested);
                nested.Add(extended, key, func);
            }
        }
Ejemplo n.º 2
0
 public Discoverer(
     [NotNull] IReflection reflection,
     [NotNull] IAttributeMap attributeMap,
     [NotNull] IAttributeAccessor attributeAccessor,
     [NotNull] IGenericArgsProvider genericArgsProvider,
     [NotNull] IArgsProvider argsProvider,
     [NotNull] Func <ITestInfo, ICase> caseFactory,
     [NotNull] IRunner runner)
 {
     if (reflection == null)
     {
         throw new ArgumentNullException(nameof(reflection));
     }
     if (attributeMap == null)
     {
         throw new ArgumentNullException(nameof(attributeMap));
     }
     if (attributeAccessor == null)
     {
         throw new ArgumentNullException(nameof(attributeAccessor));
     }
     if (genericArgsProvider == null)
     {
         throw new ArgumentNullException(nameof(genericArgsProvider));
     }
     if (argsProvider == null)
     {
         throw new ArgumentNullException(nameof(argsProvider));
     }
     if (caseFactory == null)
     {
         throw new ArgumentNullException(nameof(caseFactory));
     }
     if (runner == null)
     {
         throw new ArgumentNullException(nameof(runner));
     }
     _reflection          = reflection;
     _attributeMap        = attributeMap;
     _attributeAccessor   = attributeAccessor;
     _genericArgsProvider = genericArgsProvider;
     _argsProvider        = argsProvider;
     _caseFactory         = caseFactory;
     _runner = runner;
 }
Ejemplo n.º 3
0
 public ArgsProvider(
     [NotNull] IReflection reflection,
     [NotNull] IAttributeMap attributeMap,
     [NotNull] IAttributeAccessor attributeAccessor)
 {
     if (reflection == null)
     {
         throw new ArgumentNullException(nameof(reflection));
     }
     if (attributeMap == null)
     {
         throw new ArgumentNullException(nameof(attributeMap));
     }
     if (attributeAccessor == null)
     {
         throw new ArgumentNullException(nameof(attributeAccessor));
     }
     _reflection        = reflection;
     _attributeMap      = attributeMap;
     _attributeAccessor = attributeAccessor;
 }
Ejemplo n.º 4
0
 public AttributeRepository(IMainDBContext dbc, IAttributeMap map_factory) : base(map_factory)
 {
     entity_context = dbc;
 }
Ejemplo n.º 5
0
 public abstract void Set(IAttributeMap map);
Ejemplo n.º 6
0
 internal void Add(Type type, IAttributeMap map) => dictionary.Add(type, map);
 public AttributeRepository(IAccountDbContext dbc, IAttributeMap map, ILogger <AttributeData> log) : base(log, map)
 {
     entityContext = dbc;
 }
Ejemplo n.º 8
0
 internal static IAttributeFactory Create(IAttributeMap map) => new AttributeFactory(map);
Ejemplo n.º 9
0
 private AttributeFactory(IAttributeMap map)
 {
     this.map = map;
 }