internal ClassJoinManyCascadeDefine(ClassJoinDefineMetadata joinMetadata) { this.joinMetadata = joinMetadata; this.cascadeMetadata = joinMetadata.JoinCascade; processor = new CascadeJoinManyProcessor <TEntity, TJoin>(); cascadeMetadata.ProcessorHandler = GetProcessor; }
private ClassJoinDefine(ClassDefineMetadata metadata, ClassJoinType joinType, MemberInfo member) { this.metadata = metadata; this.joinType = joinType; this.member = member; joinMetadata = new ClassJoinDefineMetadata(); joinMetadata.JoinName = member.Name; var property = member as PropertyInfo; if (property != null) { var getMethod = property.GetGetMethod(true); if (getMethod == null) { throw new PlatformException("类型 {0} 的级联属性 {1} 必须可读。", member.DeclaringType, member.Name); } joinMetadata.Method = getMethod; joinMetadata.JoinType = MethodJoinType.PropertyGet; // set var setMethod = property.GetSetMethod(true); if (setMethod == null) { throw new PlatformException("类型 {0} 的级联属性 {1} 必须可写。", member.DeclaringType, member.Name); } var setDefine = new ClassJoinDefineMetadata(); setDefine.Method = setMethod; setDefine.JoinType = MethodJoinType.PropertySet; setDefine.JoinName = member.Name; metadata.ClassJoinDefines.Add(setDefine.Method, setDefine); } else { joinMetadata.JoinType = MethodJoinType.Method; joinMetadata.Method = (MethodInfo)member; } metadata.ClassJoinDefines.Add(joinMetadata.Method, joinMetadata); }
public EntityProxyInterceptor(object root, ClassJoinDefineMetadata joinMetadata) { this.root = root; this.joinMetadata = joinMetadata; }
public HasManyByForeignKeyClassJoinProcessor(Action <TEntity, HasManyByForeignKeyDefine> foreignKeyDefine, ClassJoinDefineMetadata metadata) { this.foreignKeyDefine = foreignKeyDefine; this.metadata = metadata; }
public HasOneClassJoinProcessor(Func <TEntity, ISpecification <TJoin>, ISpecification <TJoin> > specAction, ClassJoinDefineMetadata metadata) { this.specAction = specAction; this.metadata = metadata; }
public void Init(object root, ClassJoinDefineMetadata joinMetadata) { this.root = root; this.joinMetadata = joinMetadata; }