Skip to content

Commit 9f94928

Browse files
committed
refactor: convert UpdateSearchText to expression-bodied method and remove blank line
1 parent e575c5b commit 9f94928

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

src/ApiService/BookStore.ApiService/Endpoints/CategoryEndpoints.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace BookStore.ApiService.Endpoints;
1313
public static class CategoryEndpoints
1414
{
1515

16-
1716
public static RouteGroupBuilder MapCategoryEndpoints(this RouteGroupBuilder group)
1817
{
1918
_ = group.MapGet("/", GetCategories)

src/ApiService/BookStore.ApiService/Projections/BookSearchProjection.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,13 @@ public async Task Apply(AuthorUpdated @event, BookSearchProjection projection, I
152152
}
153153

154154
// Helper method to compute SearchText from all searchable fields
155-
static void UpdateSearchText(BookSearchProjection projection)
156-
{
155+
static void UpdateSearchText(BookSearchProjection projection) =>
157156
// Use string interpolation to avoid List<string> allocation
158157
projection.SearchText =
159158
$"{projection.Title} " +
160159
$"{projection.Isbn ?? string.Empty} " +
161160
$"{projection.PublisherName ?? string.Empty} " +
162161
$"{projection.AuthorNames}".Trim();
163-
}
164162

165163
// Projection will be deleted on BookSoftDeleted (configured in constructor)
166164
// Projection will be recreated on BookRestored by replaying the stream

0 commit comments

Comments
 (0)