mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Fix code analysis warnings
This commit is contained in:
@@ -25,7 +25,6 @@ public class CreateBreweryValidator : AbstractValidator<CreateBreweryCommand>
|
||||
|
||||
RuleFor(x => x.Location.CityId)
|
||||
.NotEmpty()
|
||||
.When(x => x.Location is not null)
|
||||
.WithMessage("CityId is required.");
|
||||
|
||||
RuleFor(x => x.Location.AddressLine1)
|
||||
@@ -33,15 +32,12 @@ public class CreateBreweryValidator : AbstractValidator<CreateBreweryCommand>
|
||||
.When(x => x.Location is not null)
|
||||
.WithMessage("Address line 1 is required.")
|
||||
.MaximumLength(256)
|
||||
.When(x => x.Location is not null)
|
||||
.WithMessage("Address line 1 cannot exceed 256 characters.");
|
||||
|
||||
RuleFor(x => x.Location.PostalCode)
|
||||
.NotEmpty()
|
||||
.When(x => x.Location is not null)
|
||||
.WithMessage("Postal code is required.")
|
||||
.MaximumLength(20)
|
||||
.When(x => x.Location is not null)
|
||||
.WithMessage("Postal code cannot exceed 20 characters.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ public static class BreweryDtoMapper
|
||||
CityName: brewery.Location.City?.CityName ?? string.Empty,
|
||||
StateProvinceName: brewery.Location.City?.StateProvince?.StateProvinceName
|
||||
?? string.Empty,
|
||||
StateProvinceCode: brewery.Location.City?.StateProvince?.ISO3166_2
|
||||
StateProvinceCode: brewery.Location.City?.StateProvince?.Iso31662
|
||||
?? string.Empty,
|
||||
CountryName: brewery.Location.City?.StateProvince?.Country?.CountryName
|
||||
?? string.Empty,
|
||||
CountryCode: brewery.Location.City?.StateProvince?.Country?.ISO3166_1
|
||||
CountryCode: brewery.Location.City?.StateProvince?.Country?.Iso31661
|
||||
?? string.Empty,
|
||||
AddressLine1: brewery.Location.AddressLine1,
|
||||
AddressLine2: brewery.Location.AddressLine2,
|
||||
|
||||
Reference in New Issue
Block a user