コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: CodeListStep.cs プロジェクト: randyammar/CoreSharp
        public void Map(ClassMappingBase classMap, Member member)
        {
            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);
            var column = mapping.Key.Columns.FirstOrDefault();

            if (column != null)
            {
                column.Set(x => x.Name, Layer.UserSupplied, "CodeListId");
            }

            classMap.AddOrReplaceCollection(mapping);
        }
コード例 #4
0
        static CollectionMapping GetCollection(Member property)
        {
            var collectionType = CollectionTypeResolver.Resolve(property);

            return(CollectionMapping.For(collectionType));
        }