当前位置: 首页>>代码示例>>C#>>正文


C# ClassMappingBase.AddCollection方法代码示例

本文整理汇总了C#中FluentNHibernate.MappingModel.ClassBased.ClassMappingBase.AddCollection方法的典型用法代码示例。如果您正苦于以下问题:C# ClassMappingBase.AddCollection方法的具体用法?C# ClassMappingBase.AddCollection怎么用?C# ClassMappingBase.AddCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FluentNHibernate.MappingModel.ClassBased.ClassMappingBase的用法示例。


在下文中一共展示了ClassMappingBase.AddCollection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Map

        public void Map(ClassMappingBase classMap, Member member)
        {
            var inverseProperty = GetInverseProperty(member);
            var parentSide = cfg.GetParentSideForManyToMany(member.DeclaringType, inverseProperty.DeclaringType);
            var mapping = GetCollection(member);

            ConfigureModel(member, mapping, classMap, parentSide);

            classMap.AddCollection(mapping);
        }
开发者ID:akhuang,项目名称:NHibernateTest,代码行数:10,代码来源:HasManyToManyStep.cs

示例2: Map

        public void Map(ClassMappingBase classMap, Member property)
        {
            var inverseProperty = GetInverseProperty(property);
            var parentSide = expressions.GetParentSideForManyToMany(property.DeclaringType, inverseProperty.DeclaringType);
            var mapping = GetCollection(property);

            ConfigureModel(property, mapping, classMap, parentSide);

            classMap.AddCollection(mapping);
        }
开发者ID:AndyStewart,项目名称:fluent-nhibernate,代码行数:10,代码来源:AutoMapManyToMany.cs

示例3: Map

        public void Map(ClassMappingBase classMap, Member member)
        {
            if (_defaultManyToManyStep.ShouldMap(member))
            {
                _defaultManyToManyStep.Map(classMap, member);
                return;
            }

            var collection = CreateManyToMany(classMap, member);
            classMap.AddCollection(collection);
        }
开发者ID:evgenyk,项目名称:Brick.FluentNHibernate.Conventions,代码行数:11,代码来源:ManyToManyConvention.cs

示例4: Map

        public void Map(ClassMappingBase classMap, PropertyInfo property)
        {
            if (property.DeclaringType != classMap.Type)
                return;

            var mapping = GetCollectionMapping(property.PropertyType);

            mapping.MemberInfo = property;
            mapping.SetDefaultValue(x => x.Name, property.Name);

            SetRelationship(property, classMap, mapping);
            SetKey(property, classMap, mapping);

            classMap.AddCollection(mapping);
        }
开发者ID:PeterBeyer,项目名称:fluent-nhibernate,代码行数:15,代码来源:AutoMapOneToMany.cs

示例5: Map

        public void Map(ClassMappingBase classMap, Member property)
        {
            if (property.DeclaringType != classMap.Type)
                return;

            var mapping = collections.CreateCollectionMapping(property.PropertyType);

            mapping.ContainingEntityType = classMap.Type;
            mapping.Member = property;
            mapping.SetDefaultValue(x => x.Name, property.Name);

            SetRelationship(property, classMap, mapping);
            keys.SetKey(property, classMap, mapping);

            classMap.AddCollection(mapping);  
        }
开发者ID:erikojebo,项目名称:fluent-nhibernate,代码行数:16,代码来源:CollectionStep.cs

示例6: Map

        public void Map(ClassMappingBase classMap, Member member)
        {
            if (member.DeclaringType != classMap.Type)
                return;

            var collectionType = CollectionTypeResolver.Resolve(member);
            var mapping = CollectionMapping.For(collectionType);

            mapping.ContainingEntityType = classMap.Type;
            mapping.Member = member;
            mapping.Set(x => x.Name, Layer.Defaults, member.Name);
            SetDefaultAccess(member, mapping);

            keys.SetKey(member, classMap, mapping);
            SetElement(member, classMap, mapping);
        
            classMap.AddCollection(mapping);
        }
开发者ID:jjchoi,项目名称:fluent-nhibernate,代码行数:18,代码来源:SimpleTypeCollectionStep.cs

示例7: Map

        public void Map(ClassMappingBase classMap, Member member)
        {
            if (member.DeclaringType != classMap.Type)
                return;

            var collectionType = CollectionTypeResolver.Resolve(member);
            var mapping = CollectionMapping.For(collectionType);

            mapping.ContainingEntityType = classMap.Type;
            mapping.Member = member;
            mapping.Set(x => x.Name, Layer.Defaults, member.Name);
            mapping.Set(x => x.ChildType, Layer.Defaults, member.PropertyType.GetGenericArguments()[0]);

            SetDefaultAccess(member, mapping);
            SetRelationship(member, classMap, mapping);
            keys.SetKey(member, classMap, mapping);

            classMap.AddCollection(mapping);  
        }
开发者ID:nsreddy1986,项目名称:fluent-nhibernate,代码行数:19,代码来源:CollectionStep.cs

示例8: Map

        public void Map(ClassMappingBase classMap, Member member)
        {
            if (member.DeclaringType != classMap.Type)
                return;

            var mapping = collections.CreateCollectionMapping(member.PropertyType);

            mapping.ContainingEntityType = classMap.Type;
            mapping.Member = member;
            mapping.SetDefaultValue(x => x.Name, member.Name);

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

            keys.SetKey(member, classMap, mapping);
            SetElement(member, classMap, mapping);
        
            classMap.AddCollection(mapping);
        }
开发者ID:roelofb,项目名称:fluent-nhibernate,代码行数:19,代码来源:SimpleTypeCollectionStep.cs


注:本文中的FluentNHibernate.MappingModel.ClassBased.ClassMappingBase.AddCollection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。