Exemplo n.º 1
0
        private void AnalyzeInternal <TItem>(ServiceCache serviceCache, Type stemType)
            where TItem : class
        {
            var stemDefinition = new StemDefinition();

            var attributeAnalyzer = new AttributeAnalyzer(_propertyAutoMapper);

            attributeAnalyzer.Analyze(stemDefinition, stemType);

            var implementations = new EngineImplementations <TItem>();

            var definitionAnalyzer = new DefinitionAnalyzer <TItem>(_analyzers);

            definitionAnalyzer.Analyze(implementations, stemDefinition);

            serviceCache.Add(stemType, implementations);
        }
Exemplo n.º 2
0
        public void Analyze(ServiceCache serviceCache, IEnumerable <Type> stemTypes)
        {
            foreach (Type stemType in stemTypes)
            {
                Type itemType = GetStemItemType(stemType);

                try
                {
                    Reflect.Instance(this).GetMethod(nameof(AnalyzeInternal))
                    .MakeGeneric(itemType)
                    .Invoke(serviceCache, stemType);
                }
                catch (TargetInvocationException ex)
                {
                    // TODO move to Reflectious
                    ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
                    throw ex.InnerException;
                }
            }
        }
Exemplo n.º 3
0
 internal AnalyzedServiceGroup(IAnalyzer <ServiceCache, IEnumerable <Type> > analyzer)
 {
     _cache    = new ServiceCache();
     _analyzer = analyzer;
 }