Exemplo n.º 1
0
        private void InitialDataFieldMapping()
        {
            var properties = ObjectTypeInfo.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            var tempList   = new List <DataFieldMapping> ();

            foreach (var pi in properties)
            {
                var mapping = DataFieldMapping.CreateCustomFieldMapping(pi, this);
                tempList.Add(mapping);
                // if (mapping != null) {
                //  tempList.Add (mapping);
                // }
            }
            if (tempList.Count == 0)
            {
                throw new LightDataException(string.Format(SR.NoMappingField, ObjectType.FullName));
            }
            _fieldList = new ReadOnlyCollection <DataFieldMapping> (tempList);
        }
Exemplo n.º 2
0
        private void InitialDataFieldMapping()
        {
            PropertyInfo []         propertys = ObjectTypeInfo.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            List <DataFieldMapping> tmepList  = new List <DataFieldMapping> ();

            foreach (PropertyInfo pi in propertys)
            {
                DataFieldMapping mapping = DataFieldMapping.CreateCustomFieldMapping(pi, this);
                if (mapping != null)
                {
                    _fieldMappingDictionary.Add(mapping.IndexName, mapping);
                    tmepList.Add(mapping);
                }
            }
            if (tmepList.Count == 0)
            {
                throw new LightDataException(string.Format(SR.NoMappingField, ObjectType.FullName));
            }
            _fieldList = new ReadOnlyCollection <DataFieldMapping> (tmepList);
        }