public void Analyze(EngineImplementations <TItem> implementations, StemDefinition stemDefinition) { foreach (FieldDefinition definition in stemDefinition.FieldDefinitions.Values) { foreach (IDefinitionAnalyzer <FieldDefinition> analyzer in _analyzers.FieldAnalyzers) { try { analyzer.Analyze(implementations, definition); } catch (Exception ex) { throw new StemAttributeSetupException("Error setting up the '" + definition.FieldName + "' field with " + analyzer.GetType().Name + ".", ex); } } } foreach (IdentifierDefinition definition in stemDefinition.IdentifierDefinitions.Values) { foreach (IDefinitionAnalyzer <IdentifierDefinition> analyzer in _analyzers.IdentifierAnalyzers) { try { analyzer.Analyze(implementations, definition); } catch (Exception ex) { throw new StemAttributeSetupException("Error setting up the '" + definition.IdentifierName + "' identifier with " + analyzer.GetType().Name + ".", ex); } } } }
public GetterAttributeResolverTests() { _definition = new StemDefinition(); _resolver = new GetterAttributeResolver(null, Display.FullItem) { Definition = _definition, Attribute = new GetAttribute(), ItemType = typeof(Person) }; }
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); }