예제 #1
0
        public static IPersistentCoreTypeMemberInfo CreateSimpleMember(this IPersistentClassInfo classInfo, DBColumnType dataType, string name)
        {
            var memberInfo = classInfo.CreateMember <IPersistentCoreTypeMemberInfo>(name);

            memberInfo.DataType = dataType;
            return(memberInfo);
        }
예제 #2
0
        public static IPersistentReferenceMemberInfo CreateReferenceMember(this IPersistentClassInfo classInfo,
                                                                           string name, string referenceTypeFullName, bool assocation = false)
        {
            var referenceMember = classInfo.CreateMember <IPersistentReferenceMemberInfo>(name);

            referenceMember.SetReferenceTypeFullName(referenceTypeFullName);
            referenceMember.Init(XafTypesInfo.Instance.FindBussinessObjectType <ICodeTemplate>());
            referenceMember.CodeTemplateInfo.CloneProperties();
            if (assocation)
            {
                var associationName = referenceMember.ReferenceClassInfo.Name + "-" + classInfo.Name;
                referenceMember.ReferenceClassInfo.CreateCollection(classInfo).CreateAssociation(associationName);
                referenceMember.CreateAssociation(associationName);
            }
            return(referenceMember);
        }