Example #1
0
 static void CreateForeignKey(IModelMemberOneToManyCollection modelMemberOneToManyCollection, XPObjectSpace objectSpace,  XpandCustomMemberInfo customMemberInfo) {
     if (CanCreateForeignKey(modelMemberOneToManyCollection, objectSpace)) {
         var throwUnableToCreateDbObjectException = ((IModelOptionMemberPersistent) modelMemberOneToManyCollection.Application.Options).ThrowUnableToCreateDbObjectException;
         var xpCustomMemberInfo = customMemberInfo.GetAssociatedMember() as XPCustomMemberInfo;
         if (xpCustomMemberInfo == null) throw new NullReferenceException("xpCustomMemberInfo");
         objectSpace.CreateForeignKey(xpCustomMemberInfo,throwUnableToCreateDbObjectException);
         modelMemberOneToManyCollection.AssociatedMember.DataStoreForeignKeyCreated = true;
         modelMemberOneToManyCollection.DataStoreForeignKeyCreated = true;
     }
 }