예제 #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);
        }
예제 #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;
                }
            }
        }
예제 #3
0
 internal AnalyzedServiceGroup(IAnalyzer <ServiceCache, IEnumerable <Type> > analyzer)
 {
     _cache    = new ServiceCache();
     _analyzer = analyzer;
 }