@@ -95,10 +95,7 @@ public async Task<List<ListAuthorsRow>> ListAuthors()
9595 }
9696
9797 if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != System . Data . ConnectionState . Open )
98- {
99- throw new System . InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
100- }
101-
98+ throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
10299 return ( await this . Transaction . Connection . QueryAsync < ListAuthorsRow > ( ListAuthorsSql , transaction : this . Transaction ) ) . AsList ( ) ;
103100 }
104101
@@ -217,10 +214,7 @@ public async Task<List<GetAuthorByNamePatternRow>> GetAuthorByNamePattern(GetAut
217214 }
218215
219216 if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != System . Data . ConnectionState . Open )
220- {
221- throw new System . InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
222- }
223-
217+ throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
224218 return ( await this . Transaction . Connection . QueryAsync < GetAuthorByNamePatternRow > ( GetAuthorByNamePatternSql , queryParams , transaction : this . Transaction ) ) . AsList ( ) ;
225219 }
226220
@@ -325,10 +319,7 @@ public async Task<List<GetAuthorsByIdsRow>> GetAuthorsByIds(GetAuthorsByIdsArgs
325319 }
326320
327321 if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != System . Data . ConnectionState . Open )
328- {
329- throw new System . InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
330- }
331-
322+ throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
332323 return ( await this . Transaction . Connection . QueryAsync < GetAuthorsByIdsRow > ( transformedSql , queryParams , transaction : this . Transaction ) ) . AsList ( ) ;
333324 }
334325
@@ -364,10 +355,7 @@ public async Task<List<GetAuthorsByIdsAndNamesRow>> GetAuthorsByIdsAndNames(GetA
364355 }
365356
366357 if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != System . Data . ConnectionState . Open )
367- {
368- throw new System . InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
369- }
370-
358+ throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
371359 return ( await this . Transaction . Connection . QueryAsync < GetAuthorsByIdsAndNamesRow > ( transformedSql , queryParams , transaction : this . Transaction ) ) . AsList ( ) ;
372360 }
373361
@@ -417,21 +405,15 @@ public async Task<List<ListAllAuthorsBooksRow>> ListAllAuthorsBooks()
417405 {
418406 var result = new List < ListAllAuthorsBooksRow > ( ) ;
419407 while ( await reader . ReadAsync ( ) )
420- {
421408 result . Add ( new ListAllAuthorsBooksRow { Author = new Author { Id = reader . GetInt64 ( 0 ) , Name = reader . GetString ( 1 ) , Bio = reader . IsDBNull ( 2 ) ? null : reader . GetString ( 2 ) } , Book = new Book { Id = reader . GetInt64 ( 3 ) , Name = reader . GetString ( 4 ) , AuthorId = reader . GetInt64 ( 5 ) , Description = reader . IsDBNull ( 6 ) ? null : reader . GetString ( 6 ) } } ) ;
422- }
423-
424409 return result ;
425410 }
426411 }
427412 }
428413 }
429414
430415 if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != System . Data . ConnectionState . Open )
431- {
432- throw new System . InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
433- }
434-
416+ throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
435417 using ( var command = this . Transaction . Connection . CreateCommand ( ) )
436418 {
437419 command . CommandText = ListAllAuthorsBooksSql ;
@@ -440,10 +422,7 @@ public async Task<List<ListAllAuthorsBooksRow>> ListAllAuthorsBooks()
440422 {
441423 var result = new List < ListAllAuthorsBooksRow > ( ) ;
442424 while ( await reader . ReadAsync ( ) )
443- {
444425 result . Add ( new ListAllAuthorsBooksRow { Author = new Author { Id = reader . GetInt64 ( 0 ) , Name = reader . GetString ( 1 ) , Bio = reader . IsDBNull ( 2 ) ? null : reader . GetString ( 2 ) } , Book = new Book { Id = reader . GetInt64 ( 3 ) , Name = reader . GetString ( 4 ) , AuthorId = reader . GetInt64 ( 5 ) , Description = reader . IsDBNull ( 6 ) ? null : reader . GetString ( 6 ) } } ) ;
445- }
446-
447426 return result ;
448427 }
449428 }
@@ -468,21 +447,15 @@ public async Task<List<GetDuplicateAuthorsRow>> GetDuplicateAuthors()
468447 {
469448 var result = new List < GetDuplicateAuthorsRow > ( ) ;
470449 while ( await reader . ReadAsync ( ) )
471- {
472450 result . Add ( new GetDuplicateAuthorsRow { Author = new Author { Id = reader . GetInt64 ( 0 ) , Name = reader . GetString ( 1 ) , Bio = reader . IsDBNull ( 2 ) ? null : reader . GetString ( 2 ) } , Author2 = new Author { Id = reader . GetInt64 ( 3 ) , Name = reader . GetString ( 4 ) , Bio = reader . IsDBNull ( 5 ) ? null : reader . GetString ( 5 ) } } ) ;
473- }
474-
475451 return result ;
476452 }
477453 }
478454 }
479455 }
480456
481457 if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != System . Data . ConnectionState . Open )
482- {
483- throw new System . InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
484- }
485-
458+ throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
486459 using ( var command = this . Transaction . Connection . CreateCommand ( ) )
487460 {
488461 command . CommandText = GetDuplicateAuthorsSql ;
@@ -491,10 +464,7 @@ public async Task<List<GetDuplicateAuthorsRow>> GetDuplicateAuthors()
491464 {
492465 var result = new List < GetDuplicateAuthorsRow > ( ) ;
493466 while ( await reader . ReadAsync ( ) )
494- {
495467 result . Add ( new GetDuplicateAuthorsRow { Author = new Author { Id = reader . GetInt64 ( 0 ) , Name = reader . GetString ( 1 ) , Bio = reader . IsDBNull ( 2 ) ? null : reader . GetString ( 2 ) } , Author2 = new Author { Id = reader . GetInt64 ( 3 ) , Name = reader . GetString ( 4 ) , Bio = reader . IsDBNull ( 5 ) ? null : reader . GetString ( 5 ) } } ) ;
496- }
497-
498468 return result ;
499469 }
500470 }
@@ -526,21 +496,15 @@ public async Task<List<GetAuthorsByBookNameRow>> GetAuthorsByBookName(GetAuthors
526496 {
527497 var result = new List < GetAuthorsByBookNameRow > ( ) ;
528498 while ( await reader . ReadAsync ( ) )
529- {
530499 result . Add ( new GetAuthorsByBookNameRow { Id = reader . GetInt64 ( 0 ) , Name = reader . GetString ( 1 ) , Bio = reader . IsDBNull ( 2 ) ? null : reader . GetString ( 2 ) , Book = new Book { Id = reader . GetInt64 ( 3 ) , Name = reader . GetString ( 4 ) , AuthorId = reader . GetInt64 ( 5 ) , Description = reader . IsDBNull ( 6 ) ? null : reader . GetString ( 6 ) } } ) ;
531- }
532-
533500 return result ;
534501 }
535502 }
536503 }
537504 }
538505
539506 if ( this . Transaction ? . Connection == null || this . Transaction ? . Connection . State != System . Data . ConnectionState . Open )
540- {
541- throw new System . InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
542- }
543-
507+ throw new InvalidOperationException ( "Transaction is provided, but its connection is null." ) ;
544508 using ( var command = this . Transaction . Connection . CreateCommand ( ) )
545509 {
546510 command . CommandText = GetAuthorsByBookNameSql ;
@@ -550,10 +514,7 @@ public async Task<List<GetAuthorsByBookNameRow>> GetAuthorsByBookName(GetAuthors
550514 {
551515 var result = new List < GetAuthorsByBookNameRow > ( ) ;
552516 while ( await reader . ReadAsync ( ) )
553- {
554517 result . Add ( new GetAuthorsByBookNameRow { Id = reader . GetInt64 ( 0 ) , Name = reader . GetString ( 1 ) , Bio = reader . IsDBNull ( 2 ) ? null : reader . GetString ( 2 ) , Book = new Book { Id = reader . GetInt64 ( 3 ) , Name = reader . GetString ( 4 ) , AuthorId = reader . GetInt64 ( 5 ) , Description = reader . IsDBNull ( 6 ) ? null : reader . GetString ( 6 ) } } ) ;
555- }
556-
557518 return result ;
558519 }
559520 }
0 commit comments