public static void Assocication(this PropertyDefinition self, CollectionProperty p1) { var name = p1.DisplayName + "-" + p1.RelationProperty.DisplayName; if (p1.RelationProperty is Property) { var p = p1.RelationProperty as Property; if (p.Owner!=null && p.Owner.IsRuntimeDefine) { var pt = p.Owner; if (pt != null) { var relationType = pt.GetTypeDefintion(); if (relationType == null) { throw new Exception("����,û���ҵ����Ͷ���!"); } var relationPropertyDefine = relationType.Properties.Single(x => x.Name == p.����); relationPropertyDefine.Assocication(name); } else { throw new Exception("��������ֻ�ܽ������û��������������.ϵͳ���õ������������ĵ�!�����Ҫ�����������͵Ĺ���,���Լ̳и�����,���������Խ�������!"); } } else { throw new Exception("��������ֻ�ܽ������û��������������!"); } } self.Assocication(name); }
public CollectionProperty AddAssociation(string name, BusinessObject bo, bool isAggregated, Property relation) { var cp = new CollectionProperty(Session); cp.称 = name; cp.Aggregated = isAggregated; cp.PropertyType = bo; cp.RelationProperty = cp; this.CollectionProperties.Add(cp); return(cp); }
public static CollectionProperty AddAssociation(this BusinessObject self, string name, BusinessObject bo, bool isAggregated, Property relation) { var cp = new CollectionProperty(self.Session); self.CollectionProperties.Add(cp); cp.PropertyType = bo; cp.称 = name; cp.Aggregated = isAggregated; cp.RelationProperty = relation; return(cp); }