Ejemplo n.º 1
0
 static void CreateForeignKey(IModelMemberOneToManyCollection modelMemberOneToManyCollection, XPObjectSpace objectSpace, XpandCustomMemberInfo customMemberInfo)
 {
     if (CanCreateForeignKey(modelMemberOneToManyCollection, objectSpace))
     {
         var xpCustomMemberInfo = customMemberInfo.GetAssociatedMember() as XPCustomMemberInfo;
         if (xpCustomMemberInfo == null)
         {
             throw new NullReferenceException("xpCustomMemberInfo");
         }
         objectSpace.CreateForeignKey(xpCustomMemberInfo);
         modelMemberOneToManyCollection.AssociatedMember.DataStoreForeignKeyCreated = true;
         modelMemberOneToManyCollection.DataStoreForeignKeyCreated = true;
     }
 }
Ejemplo n.º 2
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;
     }
 }
Ejemplo n.º 3
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;
     }
 }