AddComponent() public method

public AddComponent ( ComponentMappingBase componentMapping ) : void
componentMapping ComponentMappingBase
return void
        public void Map(ClassMappingBase classMap, Member member)
        {
            // don't map the component here, mark it as a reference which'll
            // allow us to integrate with ComponentMap or automap at a later
            // stage
            var mapping = new ReferenceComponentMapping(ComponentType.Component, member, member.PropertyType, classMap.Type, cfg.GetComponentColumnPrefix(member));

            classMap.AddComponent(mapping);
        }
        public void Map(ClassMappingBase classMap, Member property)
        {
            var mapping = new ComponentMapping(ComponentType.Component)
            {
                Name = property.Name,
                Member = property,
                ContainingEntityType = classMap.Type,
                Type = property.PropertyType
            };

            mapper.FlagAsMapped(property.PropertyType);
            mapper.MergeMap(property.PropertyType, mapping, new List<Member>());

            classMap.AddComponent(mapping);
        }
        public void Map(ClassMappingBase classMap, PropertyInfo property)
        {
            var mapping = new ComponentMapping
            {
                Name = property.Name,
                PropertyInfo = property,
                ContainingEntityType = classMap.Type,
                Type = property.PropertyType
            };

            mapper.FlagAsMapped(property.PropertyType);
            mapper.MergeMap(property.PropertyType, mapping, new List<string>());

            classMap.AddComponent(mapping);
        }
Esempio n. 4
0
        public void Map(ClassMappingBase classMap, Member member)
        {
            var mapping = new ComponentMapping(ComponentType.Component)
            {
                Name = member.Name,
                Member = member,
                ContainingEntityType = classMap.Type,
                Type = member.PropertyType,
                ColumnPrefix = cfg.GetComponentColumnPrefix(member)
            };

            if (member.IsProperty && !member.CanWrite)
                mapping.Access = cfg.GetAccessStrategyForReadOnlyProperty(member).ToString();

            mapper.FlagAsMapped(member.PropertyType);
            mapper.MergeMap(member.PropertyType, mapping, new List<Member>());

            classMap.AddComponent(mapping);
        }