@@ -952,67 +952,39 @@ void LocalLazyLoadingCode(string lmbdWhere)
952952 if ( pnv . Name . Length >= tbref . CsName . Length - 1 )
953953 midFlagStr = pnv . Name . Remove ( pnv . Name . Length - tbref . CsName . Length - 1 ) ;
954954
955- #region 在 trytb 命名空间下查找中间类
956- if ( midType == null )
955+ void midTypeFind ( TableInfo maintb , string findTypeName )
957956 {
958- midType = trytb . Type . IsNested ?
959- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . Type . DeclaringType . Name } +{ trytb . CsName } { tbref . CsName } { midFlagStr } ", false , true ) : //SongTag
960- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . CsName } { tbref . CsName } { midFlagStr } ", false , true ) ;
961- valiManyToMany ( ) ;
962- }
963- if ( midType == null )
964- {
965- midType = trytb . Type . IsNested ?
966- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . Type . DeclaringType . Name } +{ trytb . CsName } _{ tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) : //Song_Tag
967- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . CsName } _{ tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) ;
968- valiManyToMany ( ) ;
969- }
970- if ( midType == null )
971- {
972- midType = trytb . Type . IsNested ?
973- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . Type . DeclaringType . Name } +{ tbref . CsName } { trytb . CsName } { midFlagStr } ", false , true ) : //TagSong
974- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . CsName } { trytb . CsName } { midFlagStr } ", false , true ) ;
975- valiManyToMany ( ) ;
976- }
977- if ( midType == null )
978- {
979- midType = trytb . Type . IsNested ?
980- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . Type . DeclaringType . Name } +{ tbref . CsName } _{ trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) : //Tag_Song
981- trytb . Type . Assembly . GetType ( $ "{ trytb . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . CsName } _{ trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) ;
982- valiManyToMany ( ) ;
957+ if ( midType == null )
958+ {
959+ midType = maintb . Type . IsNested ?
960+ maintb . Type . Assembly . GetType ( $ "{ maintb . Type . Namespace ? . NotNullAndConcat ( "." ) } { maintb . Type . DeclaringType . Name } +{ findTypeName } ", false , true ) : //Song.SongTag
961+ maintb . Type . Assembly . GetType ( $ "{ maintb . Type . Namespace ? . NotNullAndConcat ( "." ) } { findTypeName } ", false , true ) ;
962+ valiManyToMany ( ) ;
963+ }
983964 }
984- #endregion
965+ midTypeFind ( trytb , $ "{ trytb . CsName } { tbref . CsName } { midFlagStr } ") ; //SongTag
966+ midTypeFind ( trytb , $ "{ trytb . CsName } _{ tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ") ; //Song_Tag
967+ midTypeFind ( trytb , $ "{ tbref . CsName } { trytb . CsName } { midFlagStr } ") ; //TagSong
968+ midTypeFind ( trytb , $ "{ tbref . CsName } _{ trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ") ; //Tag_Song
985969
986- #region 在 tbref 命名空间下查找中间类
987- if ( midType == null )
970+ if ( trytb . Type . Namespace != tbref . Type . Name )
988971 {
989- midType = tbref . Type . IsNested ?
990- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . Type . DeclaringType . Name } + { trytb . CsName } { tbref . CsName } { midFlagStr } " , false , true ) : //SongTag
991- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . CsName } { tbref . CsName } { midFlagStr } ", false , true ) ;
992- valiManyToMany ( ) ;
972+ midTypeFind ( tbref , $ " { trytb . CsName } { tbref . CsName } { midFlagStr } " ) ; //SongTag
973+ midTypeFind ( tbref , $ "{ trytb . CsName } _ { tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } " ) ; //Song_Tag
974+ midTypeFind ( tbref , $ "{ tbref . CsName } { trytb . CsName } { midFlagStr } ") ; //TagSong
975+ midTypeFind ( tbref , $ " { tbref . CsName } _ { trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } " ) ; //Tag_Song
993976 }
994- if ( midType == null )
995- {
996- midType = tbref . Type . IsNested ?
997- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . Type . DeclaringType . Name } +{ trytb . CsName } _{ tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) : //Song_Tag
998- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { trytb . CsName } _{ tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) ;
999- valiManyToMany ( ) ;
1000- }
1001- if ( midType == null )
1002- {
1003- midType = tbref . Type . IsNested ?
1004- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . Type . DeclaringType . Name } +{ tbref . CsName } { trytb . CsName } { midFlagStr } ", false , true ) : //TagSong
1005- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . CsName } { trytb . CsName } { midFlagStr } ", false , true ) ;
1006- valiManyToMany ( ) ;
1007- }
1008- if ( midType == null )
1009- {
1010- midType = tbref . Type . IsNested ?
1011- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . Type . DeclaringType . Name } +{ tbref . CsName } _{ trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) : //Tag_Song
1012- tbref . Type . Assembly . GetType ( $ "{ tbref . Type . Namespace ? . NotNullAndConcat ( "." ) } { tbref . CsName } _{ trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ", false , true ) ;
1013- valiManyToMany ( ) ;
1014- }
1015- #endregion
977+
978+ //嵌套子类中查找
979+ midTypeFind ( trytb , $ "{ trytb . CsName } +{ trytb . CsName } { tbref . CsName } { midFlagStr } ") ; //Song.SongTag
980+ midTypeFind ( trytb , $ "{ trytb . CsName } +{ trytb . CsName } _{ tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ") ; //Song.Song_Tag
981+ midTypeFind ( trytb , $ "{ trytb . CsName } +{ tbref . CsName } { trytb . CsName } { midFlagStr } ") ; //Song.TagSong
982+ midTypeFind ( trytb , $ "{ trytb . CsName } +{ tbref . CsName } _{ trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ") ; //Song.Tag_Song
983+
984+ midTypeFind ( tbref , $ "{ tbref . CsName } +{ trytb . CsName } { tbref . CsName } { midFlagStr } ") ; //Tag.SongTag
985+ midTypeFind ( tbref , $ "{ tbref . CsName } +{ trytb . CsName } _{ tbref . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ") ; //Tag.Song_Tag
986+ midTypeFind ( tbref , $ "{ tbref . CsName } +{ tbref . CsName } { trytb . CsName } { midFlagStr } ") ; //Tag.TagSong
987+ midTypeFind ( tbref , $ "{ tbref . CsName } +{ tbref . CsName } _{ trytb . CsName } { ( string . IsNullOrEmpty ( midFlagStr ) ? "" : "_" ) } { midFlagStr } ") ; //Tag.Tag_Song
1016988 }
1017989
1018990 isManyToMany = midType != null ;
0 commit comments