Exemplo n.º 1
0
 public DCPropertyInfo(string name, Type propertyType, XPClassInfo declaringType, bool canRead, bool canWrite, XpandCustomMemberInfo xpandCustomMemberInfo) {
     _nameCore = name;
     _propertyTypeCore = propertyType;
     _declaringTypeCore = declaringType;
     _canReadCore = canRead;
     _canWriteCore = canWrite;
     _xpandCustomMemberInfo = xpandCustomMemberInfo;
     _attributesCore.AddRange(xpandCustomMemberInfo.Attributes);
 }
Exemplo n.º 2
0
 static void CreateColumn(IModelMemberPersistent modelMemberPersistent, XPObjectSpace objectSpace, 
                          XpandCustomMemberInfo customMemberInfo) {
     if (CanCreateColumn(modelMemberPersistent, objectSpace)) {
         objectSpace.CreateColumn(customMemberInfo, ((IModelOptionMemberPersistent)modelMemberPersistent.Application.Options).ThrowUnableToCreateDbObjectException);
         modelMemberPersistent.DataStoreColumnCreated = true;
         modelMemberPersistent.DataStoreForeignKeyCreated = customMemberInfo.HasAttribute(typeof(AssociationAttribute));
     }
 }
Exemplo n.º 3
0
 DCPropertyInfo DcPropertyInfo(XPClassInfo classInfo, XpandCustomMemberInfo info) {
     return new DCPropertyInfo(info.Name, info.MemberType, classInfo, true, !info.IsReadOnly, info);
 }
Exemplo n.º 4
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;
     }
 }