forked from MarcosHCK/sep3cs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c13a27
commit 804cd37
Showing
9 changed files
with
383 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* Copyright (c) 2023-2025 | ||
* This file is part of sep3cs. | ||
* | ||
* sep3cs is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sep3cs is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with sep3cs. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
using DataClash.Application.Common.Interfaces; | ||
using MediatR; | ||
using FluentValidation; | ||
|
||
namespace DataClash.Application.Statistics.AllClanNames | ||
{ | ||
public record GetAllClanNamesQuery : IRequest<List<string>>; | ||
|
||
public class GetAllClanNamesQueryHandler : IRequestHandler<GetAllClanNamesQuery, List<string>> | ||
{ | ||
private readonly IApplicationDbContext _context; | ||
|
||
public GetAllClanNamesQueryHandler(IApplicationDbContext context) | ||
{ | ||
_context = context; | ||
} | ||
|
||
public async Task<List<string>> Handle(GetAllClanNamesQuery request, CancellationToken cancellationToken) | ||
Check warning on line 35 in src/Application/Statistics/ClanNamesQuery.cs GitHub Actions / build
|
||
{ | ||
var allClanNames = _context.Clans.Select(c => c.Name).ToList(); | ||
return allClanNames; | ||
} | ||
} | ||
|
||
public class GetAllClanNamesQueryValidator : AbstractValidator<GetAllClanNamesQuery> | ||
{ | ||
public GetAllClanNamesQueryValidator() | ||
{ | ||
// Add validation rules here | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.