Refactor BookScansController and Iso31661NumericController methods to use synchronous Task return types for improved readability

This commit is contained in:
2025-11-13 19:00:38 +00:00
parent fc6238aef1
commit 34d76fd646
2 changed files with 4 additions and 4 deletions

View File

@@ -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]

View File

@@ -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();
} }