mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Refactor BookScansController and Iso31661NumericController methods to use synchronous Task return types for improved readability
This commit is contained in:
@@ -45,8 +45,8 @@ public class BookScansController(MarechaiContext context) : ControllerBase
|
|||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
public async Task<List<Guid>> GetGuidsByBookAsync(long bookId) =>
|
public Task<List<Guid>> GetGuidsByBookAsync(long bookId) =>
|
||||||
await context.BookScans.Where(p => p.BookId == bookId).Select(p => p.Id).ToListAsync();
|
context.BookScans.Where(p => p.BookId == bookId).Select(p => p.Id).ToListAsync();
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
|
|||||||
@@ -46,6 +46,6 @@ public class Iso31661NumericController(MarechaiContext context) : ControllerBase
|
|||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
public async Task<List<Iso31661Numeric>> GetAsync() =>
|
public Task<List<Iso31661Numeric>> GetAsync() =>
|
||||||
await context.Iso31661Numeric.OrderBy(c => c.Name).ToListAsync();
|
context.Iso31661Numeric.OrderBy(c => c.Name).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user