Exemple #1
0
        void createTheManyPart(IPersistentReferenceMemberInfo persistentReferenceMemberInfo)
        {
            IPersistentClassInfo classInfo = PersistentClassInfoQuery.Find(((XPObjectSpace)ObjectSpace).Session, persistentReferenceMemberInfo.ReferenceTypeFullName);
            string collectionPropertyName  = persistentReferenceMemberInfo.Name + "s";

            if (classInfo != null && classInfo.OwnMembers.FirstOrDefault(info => info.Name == collectionPropertyName) == null)
            {
                var associationAttribute = PersistentAttributeInfoQuery.Find <AssociationAttribute>(persistentReferenceMemberInfo);
                classInfo.CreateCollection(persistentReferenceMemberInfo.Owner.PersistentAssemblyInfo.Name,
                                           persistentReferenceMemberInfo.Owner.Name).CreateAssociation(associationAttribute.Name);
            }
        }
Exemple #2
0
 public static bool IsAssociation(this IPersistentMemberInfo persistentMemberInfo)
 {
     return(PersistentAttributeInfoQuery.Find <AssociationAttribute>(persistentMemberInfo) != null);
 }