chore: update nuget packages
This commit is contained in:
@@ -6,12 +6,11 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Ardalis.Result.FluentValidation" Version="7.2.0" />
|
||||
<PackageVersion Include="Ardalis.Result" Version="7.2.0" />
|
||||
<PackageVersion Include="Ardalis.Result" Version="8.0.0" />
|
||||
<PackageVersion Include="AspNetCore.HealthChecks.MongoDb" Version="8.0.0" />
|
||||
<PackageVersion Include="AspNetCore.HealthChecks.Redis" Version="8.0.0" />
|
||||
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.0" />
|
||||
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||
<PackageVersion Include="AutoMapper" Version="12.0.1" />
|
||||
<PackageVersion Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageVersion Include="Bogus" Version="35.4.0" />
|
||||
<PackageVersion Include="coverlet.collector" Version="6.0.1" />
|
||||
<PackageVersion Include="coverlet.msbuild" Version="6.0.1" />
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Ardalis.Result;
|
||||
@@ -39,7 +38,7 @@ public class UpdateCustomerCommandHandler(
|
||||
// Instantiating the Email value object.
|
||||
var emailResult = Email.Create(request.Email);
|
||||
if (!emailResult.IsSuccess)
|
||||
return Result.Error(emailResult.Errors.ToArray());
|
||||
return Result.Error([.. emailResult.Errors]);
|
||||
|
||||
// Checking if there is already a customer with the email address.
|
||||
if (await _repository.ExistsByEmailAsync(emailResult.Value, customer.Id))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Ardalis.Result;
|
||||
using Shop.Domain.Entities.CustomerAggregate;
|
||||
using Shop.Domain.ValueObjects;
|
||||
@@ -17,7 +16,7 @@ public static class CustomerFactory
|
||||
{
|
||||
var emailResult = Email.Create(email);
|
||||
return !emailResult.IsSuccess
|
||||
? Result<Customer>.Error(emailResult.Errors.ToArray())
|
||||
? Result<Customer>.Error([.. emailResult.Errors])
|
||||
: Result<Customer>.Success(new Customer(firstName, lastName, gender, emailResult.Value, dateOfBirth));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ internal static class ResultExtensions
|
||||
|
||||
var validationErrors = result
|
||||
.ValidationErrors
|
||||
.ConvertAll(validation => new ApiErrorResponse(validation.ErrorMessage));
|
||||
.Select(validation => new ApiErrorResponse(validation.ErrorMessage));
|
||||
|
||||
return new BadRequestObjectResult(ApiResponse.BadRequest(validationErrors));
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Ardalis.Result.FluentValidation" />
|
||||
<PackageReference Include="Ardalis.Result" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" />
|
||||
<PackageReference Include="AutoMapper" />
|
||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" />
|
||||
<PackageReference Include="FluentValidation" />
|
||||
|
||||
Reference in New Issue
Block a user