Skip to content

Commit 47578ad

Browse files
committed
refactor: replace unused method parameters with discards for cleaner code
1 parent fc08294 commit 47578ad

9 files changed

Lines changed: 12 additions & 13 deletions

File tree

src/ApiService/BookStore.ApiService/Aggregates/AuthorAggregate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ void Apply(AuthorUpdated @event)
2424
Biography = @event.Biography;
2525
}
2626

27-
void Apply(AuthorSoftDeleted @event) => IsDeleted = true;
27+
void Apply(AuthorSoftDeleted _) => IsDeleted = true;
2828

29-
void Apply(AuthorRestored @event) => IsDeleted = false;
29+
void Apply(AuthorRestored _) => IsDeleted = false;
3030

3131
// Command methods
3232
public static AuthorAdded Create(Guid id, string name, string? biography)

src/ApiService/BookStore.ApiService/Aggregates/BookAggregate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ void Apply(BookUpdated @event)
4040
CategoryIds = @event.CategoryIds;
4141
}
4242

43-
void Apply(BookSoftDeleted @event) => IsDeleted = true;
43+
void Apply(BookSoftDeleted _) => IsDeleted = true;
4444

45-
void Apply(BookRestored @event) => IsDeleted = false;
45+
void Apply(BookRestored _) => IsDeleted = false;
4646

4747
// Command methods
4848
public static BookAdded Create(

src/ApiService/BookStore.ApiService/Aggregates/CategoryAggregate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ void Apply(CategoryUpdated @event)
2727
Translations = @event.Translations ?? [];
2828
}
2929

30-
void Apply(CategorySoftDeleted @event) => IsDeleted = true;
30+
void Apply(CategorySoftDeleted _) => IsDeleted = true;
3131

32-
void Apply(CategoryRestored @event) => IsDeleted = false;
32+
void Apply(CategoryRestored _) => IsDeleted = false;
3333

3434
// Command methods
3535
public static CategoryAdded Create(Guid id, string name, string? description, Dictionary<string, CategoryTranslation>? translations = null)

src/ApiService/BookStore.ApiService/Aggregates/PublisherAggregate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ void Apply(PublisherAdded @event)
1818

1919
void Apply(PublisherUpdated @event) => Name = @event.Name;
2020

21-
void Apply(PublisherSoftDeleted @event) => IsDeleted = true;
21+
void Apply(PublisherSoftDeleted _) => IsDeleted = true;
2222

23-
void Apply(PublisherRestored @event) => IsDeleted = false;
23+
void Apply(PublisherRestored _) => IsDeleted = false;
2424

2525
// Command methods
2626
public static PublisherAdded Create(Guid id, string name)

src/ApiService/BookStore.ApiService/Infrastructure/ETagHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static bool CheckIfNoneMatch(HttpContext context, string currentETag)
5656
/// <summary>
5757
/// Create a 304 Not Modified response with ETag
5858
/// </summary>
59-
public static IResult NotModified(string etag) => Results.StatusCode(304);
59+
public static IResult NotModified(string _) => Results.StatusCode(304);
6060

6161
/// <summary>
6262
/// Create a 412 Precondition Failed response

src/ApiService/BookStore.ApiService/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@
171171
_ = x.ToSignalR();
172172
});
173173

174-
175174
// Policies for automatic behavior
176175
opts.Policies.AutoApplyTransactions();
177176
});

src/ApiService/BookStore.ApiService/Projections/AuthorStatisticsProjection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public AuthorStatisticsProjectionBuilder()
3434
};
3535

3636
// When a book is added, increment count for each author
37-
public async Task Apply(BookAdded @event, AuthorStatistics projection, IQuerySession session)
37+
public async Task Apply(BookAdded @event, AuthorStatistics projection, IQuerySession _)
3838
{
3939
// Check if this author is in the book's author list
4040
if (@event.AuthorIds.Contains(projection.Id))

src/ApiService/BookStore.ApiService/Projections/CategoryStatisticsProjection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public CategoryStatisticsProjectionBuilder()
3434
};
3535

3636
// When a book is added, increment count for each category
37-
public async Task Apply(BookAdded @event, CategoryStatistics projection, IQuerySession session)
37+
public async Task Apply(BookAdded @event, CategoryStatistics projection, IQuerySession _)
3838
{
3939
if (@event.CategoryIds.Contains(projection.Id))
4040
{

src/ApiService/BookStore.ApiService/Projections/PublisherStatisticsProjection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public PublisherStatisticsProjectionBuilder()
3434
};
3535

3636
// When a book is added, increment count if it uses this publisher
37-
public async Task Apply(BookAdded @event, PublisherStatistics projection, IQuerySession session)
37+
public async Task Apply(BookAdded @event, PublisherStatistics projection, IQuerySession _)
3838
{
3939
if (@event.PublisherId == projection.Id)
4040
{

0 commit comments

Comments
 (0)