-
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.
feat: use C# 9 records where possible
- Loading branch information
Showing
21 changed files
with
28 additions
and
163 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
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 was deleted.
Oops, something went wrong.
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
16 changes: 1 addition & 15 deletions
16
src/Covid19Api.Services.Abstractions/Models/CountryMetaData.cs
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 |
---|---|---|
@@ -1,18 +1,4 @@ | ||
namespace Covid19Api.Services.Abstractions.Models | ||
{ | ||
public class CountryMetaData | ||
{ | ||
public CountryMetaData(string name, string alpha2Code, string[] altSpellings) | ||
{ | ||
this.Name = name; | ||
this.Alpha2Code = alpha2Code; | ||
this.AltSpellings = altSpellings; | ||
} | ||
|
||
public string Name { get; } | ||
|
||
public string Alpha2Code { get; } | ||
|
||
public string[] AltSpellings { get; } | ||
} | ||
public sealed record CountryMetaData(string Name, string Alpha2Code, string[] AltSpellings); | ||
} |
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
18 changes: 2 additions & 16 deletions
18
src/Covid19Api.UseCases.Abstractions/Commands/AggregateCountryStatisticsCommand.cs
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 |
---|---|---|
@@ -1,21 +1,7 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using MediatR; | ||
|
||
namespace Covid19Api.UseCases.Abstractions.Commands | ||
{ | ||
public class AggregateCountryStatisticsCommand : IRequest | ||
{ | ||
public AggregateCountryStatisticsCommand(string[] countries, int month, int year) | ||
{ | ||
this.Countries = countries ?? throw new ArgumentNullException(nameof(countries)); | ||
this.Month = month; | ||
this.Year = year; | ||
} | ||
|
||
public string[] Countries { get; } | ||
|
||
public int Month { get; } | ||
|
||
public int Year { get; } | ||
} | ||
public sealed record AggregateCountryStatisticsCommand(IEnumerable<string> Countries, int Month, int Year) : IRequest; | ||
} |
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
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
17 changes: 2 additions & 15 deletions
17
...eries/CountryStatisticsAggregates/LoadCountryStatisticsAggregatesForCountryInYearQuery.cs
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 |
---|---|---|
@@ -1,22 +1,9 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Covid19Api.Presentation.Response; | ||
using MediatR; | ||
|
||
namespace Covid19Api.UseCases.Abstractions.Queries.CountryStatisticsAggregates | ||
{ | ||
public class | ||
LoadCountryStatisticsAggregatesForCountryInYearQuery : IRequest<IEnumerable<CountryStatisticAggregateDto>> | ||
{ | ||
public LoadCountryStatisticsAggregatesForCountryInYearQuery(string country, int year) | ||
{ | ||
this.Country = country; | ||
this.Year = year; | ||
|
||
if (string.IsNullOrWhiteSpace(this.Country)) throw new ArgumentNullException(nameof(country)); | ||
} | ||
|
||
public string Country { get; } | ||
public int Year { get; } | ||
} | ||
public sealed record LoadCountryStatisticsAggregatesForCountryInYearQuery | ||
(string Country, int Year) : IRequest<IEnumerable<CountryStatisticAggregateDto>>; | ||
} |
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