本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}