コード例 #1
0
        public ClarifyGenericMapEntry BuildFromModelMap <MODEL>(ModelMap <MODEL> modelMap)
        {
            var visitor = _container.GetInstance <DovetailGenericModelMapVisitor>();

            modelMap.Accept(visitor);
            return(visitor.RootGenericMap);
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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];
        }
コード例 #4
0
        public ClarifyGenericMapEntry BuildFromModelMap(ModelMap modelMap)
        {
            var visitor = _container.GetInstance <DovetailGenericModelMapVisitor>();

            modelMap.Accept(visitor);
            var generic = visitor.RootGenericMap;

            generic.Entity = modelMap.Entity;

            return(generic);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public ModelInspector(ModelMap <MODEL> modelMap, ModelInspectorVisitor modelInspectorVisitor)
 {
     _modelMap = modelMap;
     _modelInspectorVisitor = modelInspectorVisitor;
 }
コード例 #7
0
 public void ReplaceWith(ModelMap map)
 {
     _instructions.Clear();
     map._instructions.Each(_ => _instructions.Add(_));
 }
コード例 #8
0
 protected bool Equals(ModelMap other)
 {
     return(string.Equals(_name, other._name, StringComparison.OrdinalIgnoreCase));
 }