public ClarifyGenericMapEntry BuildFromModelMap <MODEL>(ModelMap <MODEL> modelMap) { var visitor = _container.GetInstance <DovetailGenericModelMapVisitor>(); modelMap.Accept(visitor); return(visitor.RootGenericMap); }
private ModelData assembleWithIdentifier(ModelMap map, string identifier, ClarifyGenericMapEntry rootGenericMap) { var identifierFieldName = findIdentifierFieldName(map, rootGenericMap); var filter = FilterType.Equals(identifierFieldName, identifier); return(assembleWithFilter(filter, rootGenericMap, null).Models.FirstOrDefault()); }
public ModelBuilder(ModelMap <MODEL> modelMap, IClarifyListCache listCache, ISchemaCache schemaCache, IModelBuilderResultEncoder assemblerResultEncoder, IMapEntryBuilder mapEntryBuilder) { _modelMap = modelMap; _mapEntryBuilder = mapEntryBuilder; _assemblerResultEncoder = assemblerResultEncoder; _schemaCache = schemaCache; _listCache = listCache; FieldSortMapOverrides = new FieldSortMap[0]; }
public ClarifyGenericMapEntry BuildFromModelMap(ModelMap modelMap) { var visitor = _container.GetInstance <DovetailGenericModelMapVisitor>(); modelMap.Accept(visitor); var generic = visitor.RootGenericMap; generic.Entity = modelMap.Entity; return(generic); }
private static string findIdentifierFieldName(ModelMap map, ClarifyGenericMapEntry rootGenericMap) { var identifierFieldName = rootGenericMap.GetIdentifierFieldName(); if (identifierFieldName == null) { throw new DovetailMappingException(1003, "Map \"{0}\" does not have an identifying field defined.", map.Name); } return(identifierFieldName); }
public ModelInspector(ModelMap <MODEL> modelMap, ModelInspectorVisitor modelInspectorVisitor) { _modelMap = modelMap; _modelInspectorVisitor = modelInspectorVisitor; }
public void ReplaceWith(ModelMap map) { _instructions.Clear(); map._instructions.Each(_ => _instructions.Add(_)); }
protected bool Equals(ModelMap other) { return(string.Equals(_name, other._name, StringComparison.OrdinalIgnoreCase)); }