1- // Copyright (C) 2010-2020 Xtensive LLC.
1+ // Copyright (C) 2010-2022 Xtensive LLC.
22// This code is distributed under MIT license terms.
33// See the License.txt file in the project root for more information.
44// Created by: Alex Yakunin
@@ -256,22 +256,18 @@ internal void NotifyDbCommandExecuted(DbCommand command, Exception exception = n
256256 internal Expression NotifyQueryExecuting ( Expression expression )
257257 {
258258 var args = new QueryEventArgs ( expression ) ;
259- if ( QueryExecuting != null ) {
260- QueryExecuting ( this , args ) ;
261- }
259+ QueryExecuting ? . Invoke ( this , args ) ;
262260 return args . Expression ;
263261 }
264262
265263 internal void NotifyQueryExecuted ( Expression expression , Exception exception = null )
266264 {
267- if ( QueryExecuted != null )
268- QueryExecuted ( this , new QueryEventArgs ( expression , exception ) ) ;
265+ QueryExecuted ? . Invoke ( this , new QueryEventArgs ( expression , exception ) ) ;
269266 }
270267
271268 internal void NotifyDisposing ( )
272269 {
273- if ( Disposing != null )
274- Disposing ( this , EventArgs . Empty ) ;
270+ Disposing ? . Invoke ( this , EventArgs . Empty ) ;
275271 }
276272
277273 internal void NotifyPersisting ( )
@@ -509,4 +505,4 @@ internal SessionEventAccessor(Session session, bool systemEvents)
509505 SystemEvents = systemEvents ;
510506 }
511507 }
512- }
508+ }
0 commit comments