@@ -81,18 +81,18 @@ internal ConcurrentDictionary<string, bool> _dicSycedGetOrAdd(Type entityType)
8181 internal void _dicSycedTryAdd ( Type entityType , string tableName = null ) =>
8282 _dicSycedGetOrAdd ( entityType ) . TryAdd ( GetTableNameLowerOrUpper ( tableName ) , true ) ;
8383
84- public bool SyncStructure < TEntity > ( ) =>
84+ public void SyncStructure < TEntity > ( ) =>
8585 this . SyncStructure ( new TypeAndName ( typeof ( TEntity ) , "" ) ) ;
86- public bool SyncStructure ( params Type [ ] entityTypes ) => entityTypes == null ? false :
87- this . SyncStructure ( entityTypes . Distinct ( ) . Select ( a => new TypeAndName ( a , "" ) ) . ToArray ( ) ) ;
88- public bool SyncStructure ( Type entityType , string tableName ) =>
86+ public void SyncStructure ( params Type [ ] entityTypes ) =>
87+ this . SyncStructure ( entityTypes ? . Distinct ( ) . Select ( a => new TypeAndName ( a , "" ) ) . ToArray ( ) ) ;
88+ public void SyncStructure ( Type entityType , string tableName ) =>
8989 this . SyncStructure ( new TypeAndName ( entityType , GetTableNameLowerOrUpper ( tableName ) ) ) ;
90- protected bool SyncStructure ( params TypeAndName [ ] objects )
90+ protected void SyncStructure ( params TypeAndName [ ] objects )
9191 {
92- if ( objects == null ) return false ;
92+ if ( objects == null ) return ;
9393 var syncObjects = objects . Where ( a => _dicSycedGetOrAdd ( a . entityType ) . ContainsKey ( GetTableNameLowerOrUpper ( a . tableName ) ) == false && GetTableByEntity ( a . entityType ) ? . DisableSyncStructure == false )
9494 . Select ( a => new TypeAndName ( a . entityType , GetTableNameLowerOrUpper ( a . tableName ) ) ) . ToArray ( ) ;
95- if ( syncObjects . Any ( ) == false ) return false ;
95+ if ( syncObjects . Any ( ) == false ) return ;
9696 var before = new Aop . SyncStructureBeforeEventArgs ( syncObjects . Select ( a => a . entityType ) . ToArray ( ) ) ;
9797 _orm . Aop . SyncStructureBeforeHandler ? . Invoke ( this , before ) ;
9898 Exception exception = null ;
@@ -105,11 +105,11 @@ protected bool SyncStructure(params TypeAndName[] objects)
105105 if ( string . IsNullOrEmpty ( ddl ) )
106106 {
107107 foreach ( var syncObject in syncObjects ) _dicSycedTryAdd ( syncObject . entityType , syncObject . tableName ) ;
108- return true ;
108+ return ;
109109 }
110110 var affrows = ExecuteDDLStatements ( ddl ) ;
111111 foreach ( var syncObject in syncObjects ) _dicSycedTryAdd ( syncObject . entityType , syncObject . tableName ) ;
112- return true ;
112+ return ;
113113 }
114114 }
115115 catch ( Exception ex )
0 commit comments