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); }
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); }
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); }
static CollectionMapping GetCollection(Member property) { var collectionType = CollectionTypeResolver.Resolve(property); return(CollectionMapping.For(collectionType)); }