Skip to content

Commit 59128b0

Browse files
Merge pull request #339 from TransactionProcessing/task/#313_update_shared_nugets
using latest shared nuget packages
2 parents 0bb830f + 209a68d commit 59128b0

26 files changed

Lines changed: 144 additions & 363 deletions

File tree

MessagingService.BusinessLogic.Tests/MessagingService.BusinessLogic.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Lamar" Version="15.0.0" />
10+
<PackageReference Include="Lamar" Version="15.0.1" />
1111
<PackageReference Include="Moq" Version="4.20.72" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
1313
<PackageReference Include="Shouldly" Version="4.3.0" />
1414
<PackageReference Include="xunit" Version="2.9.3" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
15+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>

MessagingService.BusinessLogic/Common/ConfigurationReaderConnectionStringRepository.cs

Lines changed: 0 additions & 91 deletions
This file was deleted.

MessagingService.BusinessLogic/MessagingService.BusinessLogic.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="NLog.Extensions.Logging" Version="5.5.0" />
9-
<PackageReference Include="MediatR" Version="12.5.0" />
10-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
13-
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.3" />
8+
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.5" />
9+
<PackageReference Include="MediatR" Version="13.1.0" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.10" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.10" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
13+
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
1414
<PackageReference Include="SimpleResults" Version="4.0.0" />
1515
</ItemGroup>
1616

@@ -20,4 +20,8 @@
2020
<ProjectReference Include="..\MessagingService.SMSMessageAggregate\MessagingService.SMSMessageAggregate.csproj" />
2121
</ItemGroup>
2222

23+
<ItemGroup>
24+
<Folder Include="Common\" />
25+
</ItemGroup>
26+
2327
</Project>

MessagingService.Client/IMessagingServiceClient.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ namespace MessagingService.Client
1313
public interface IMessagingServiceClient
1414
{
1515
#region Methods
16-
17-
/// <summary>
18-
/// Sends the email.
19-
/// </summary>
20-
/// <param name="accessToken">The access token.</param>
21-
/// <param name="request">The request.</param>
22-
/// <param name="cancellationToken">The cancellation token.</param>
23-
/// <returns></returns>
2416
Task<Result> SendEmail(String accessToken,
2517
SendEmailRequest request,
2618
CancellationToken cancellationToken);
@@ -29,13 +21,6 @@ Task<Result> ResendEmail(String accessToken,
2921
ResendEmailRequest request,
3022
CancellationToken cancellationToken);
3123

32-
/// <summary>
33-
/// Sends the SMS.
34-
/// </summary>
35-
/// <param name="accessToken">The access token.</param>
36-
/// <param name="request">The request.</param>
37-
/// <param name="cancellationToken">The cancellation token.</param>
38-
/// <returns></returns>
3924
Task<Result> SendSMS(String accessToken,
4025
SendSMSRequest request,
4126
CancellationToken cancellationToken);

MessagingService.Client/MessagingService.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="ClientProxyBase" Version="2025.7.13" />
10-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
11-
<PackageReference Include="Shared.Results" Version="2025.7.13" />
9+
<PackageReference Include="ClientProxyBase" Version="2025.10.2" />
10+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
11+
<PackageReference Include="Shared.Results" Version="2025.10.2" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

MessagingService.Client/MessagingServiceClient.cs

Lines changed: 4 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,18 @@ namespace MessagingService.Client
1313
using Newtonsoft.Json;
1414
using SimpleResults;
1515

16-
/// <summary>
17-
///
18-
/// </summary>
19-
/// <seealso cref="ClientProxyBase" />
20-
/// <seealso cref="MessagingService.Client.IMessagingServiceClient" />
2116
public class MessagingServiceClient : ClientProxyBase, IMessagingServiceClient
2217
{
2318
#region Fields
2419

25-
/// <summary>
26-
/// The base address
27-
/// </summary>
2820
private readonly String BaseAddress;
2921

30-
/// <summary>
31-
/// The base address resolver
32-
/// </summary>
3322
private readonly Func<String, String> BaseAddressResolver;
3423

3524
#endregion
3625

3726
#region Constructors
3827

39-
/// <summary>
40-
/// Initializes a new instance of the <see cref="MessagingServiceClient"/> class.
41-
/// </summary>
42-
/// <param name="baseAddressResolver">The base address resolver.</param>
43-
/// <param name="httpClient">The HTTP client.</param>
4428
public MessagingServiceClient(Func<String, String> baseAddressResolver,
4529
HttpClient httpClient) : base(httpClient)
4630
{
@@ -51,13 +35,6 @@ public MessagingServiceClient(Func<String, String> baseAddressResolver,
5135

5236
#region Methods
5337

54-
/// <summary>
55-
/// Sends the email.
56-
/// </summary>
57-
/// <param name="accessToken">The access token.</param>
58-
/// <param name="sendEmailRequest">The send email request.</param>
59-
/// <param name="cancellationToken">The cancellation token.</param>
60-
/// <returns></returns>
6138
public async Task<Result> SendEmail(String accessToken,
6239
SendEmailRequest sendEmailRequest,
6340
CancellationToken cancellationToken)
@@ -66,19 +43,8 @@ public async Task<Result> SendEmail(String accessToken,
6643

6744
try
6845
{
69-
String requestSerialised = JsonConvert.SerializeObject(sendEmailRequest);
70-
71-
StringContent httpContent = new(requestSerialised, Encoding.UTF8, "application/json");
72-
73-
// Add the access token to the client headers
74-
this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
75-
76-
// Make the Http Call here
77-
HttpResponseMessage httpResponse = await this.HttpClient.PostAsync(requestUri, httpContent, cancellationToken);
78-
79-
// Process the response
80-
Result<String> result = await this.HandleResponseX(httpResponse, cancellationToken);
81-
46+
Result<ResponseData<String>> result = await this.SendPostRequest<SendEmailRequest, ResponseData<String>>(requestUri, accessToken, sendEmailRequest, cancellationToken);
47+
8248
if (result.IsFailed)
8349
return ResultHelpers.CreateFailure(result);
8450

@@ -99,18 +65,7 @@ public async Task<Result> ResendEmail(String accessToken,
9965
String requestUri = this.BuildRequestUrl("/api/email/resend");
10066

10167
try {
102-
String requestSerialised = JsonConvert.SerializeObject(resendEmailRequest);
103-
104-
StringContent httpContent = new(requestSerialised, Encoding.UTF8, "application/json");
105-
106-
// Add the access token to the client headers
107-
this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
108-
109-
// Make the Http Call here
110-
HttpResponseMessage httpResponse = await this.HttpClient.PostAsync(requestUri, httpContent, cancellationToken);
111-
112-
// Process the response
113-
Result<String> result = await this.HandleResponseX(httpResponse, cancellationToken);
68+
Result<ResponseData<String>> result = await this.SendPostRequest<ResendEmailRequest, ResponseData<String>>(requestUri, accessToken, resendEmailRequest, cancellationToken);
11469

11570
if (result.IsFailed)
11671
return ResultHelpers.CreateFailure(result);
@@ -125,13 +80,6 @@ public async Task<Result> ResendEmail(String accessToken,
12580
}
12681
}
12782

128-
/// <summary>
129-
/// Sends the SMS.
130-
/// </summary>
131-
/// <param name="accessToken">The access token.</param>
132-
/// <param name="sendSMSRequest">The send SMS request.</param>
133-
/// <param name="cancellationToken">The cancellation token.</param>
134-
/// <returns></returns>
13583
public async Task<Result> SendSMS(String accessToken,
13684
SendSMSRequest sendSMSRequest,
13785
CancellationToken cancellationToken)
@@ -140,18 +88,7 @@ public async Task<Result> SendSMS(String accessToken,
14088

14189
try
14290
{
143-
String requestSerialised = JsonConvert.SerializeObject(sendSMSRequest);
144-
145-
StringContent httpContent = new(requestSerialised, Encoding.UTF8, "application/json");
146-
147-
// Add the access token to the client headers
148-
this.HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
149-
150-
// Make the Http Call here
151-
HttpResponseMessage httpResponse = await this.HttpClient.PostAsync(requestUri, httpContent, cancellationToken);
152-
153-
// Process the response
154-
Result<String> result = await this.HandleResponseX(httpResponse, cancellationToken);
91+
Result<ResponseData<String>> result = await this.SendPostRequest<SendSMSRequest, ResponseData<String>>(requestUri, accessToken, sendSMSRequest, cancellationToken);
15592

15693
if (result.IsFailed)
15794
return ResultHelpers.CreateFailure(result);
@@ -166,12 +103,6 @@ public async Task<Result> SendSMS(String accessToken,
166103
throw exception;
167104
}
168105
}
169-
170-
/// <summary>
171-
/// Builds the request URL.
172-
/// </summary>
173-
/// <param name="route">The route.</param>
174-
/// <returns></returns>
175106
private String BuildRequestUrl(String route)
176107
{
177108
String baseAddress = this.BaseAddressResolver("MessagingServiceApi");

MessagingService.DataTransferObjects/MessagingService.DataTransferObjects.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
12+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
1313
</ItemGroup>
1414

1515
</Project>

MessagingService.EmailAggregate.Tests/MessagingService.EmailAggregate.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
11-
<PackageReference Include="Shared.EventStore" Version="2025.7.13" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
11+
<PackageReference Include="Shared.EventStore" Version="2025.10.2" />
1212
<PackageReference Include="Shouldly" Version="4.3.0" />
1313
<PackageReference Include="xunit" Version="2.9.3" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
14+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>

MessagingService.EmailMessage.DomainEvents/MessagingService.EmailMessage.DomainEvents.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Shared" Version="2025.7.13" />
10-
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.7.13" />
9+
<PackageReference Include="Shared" Version="2025.10.2" />
10+
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.10.2" />
1111
</ItemGroup>
1212

1313
</Project>

MessagingService.EmailMessageAggregate/EmailAggregate.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ public EmailAggregate()
295295

296296
private EmailAggregate(Guid aggregateId)
297297
{
298-
Guard.ThrowIfInvalidGuid(aggregateId, "Aggregate Id cannot be an Empty Guid");
298+
if (aggregateId == Guid.Empty)
299+
throw new ArgumentNullException(nameof(aggregateId));
299300

300301
this.AggregateId = aggregateId;
301302
this.MessageId = aggregateId;

0 commit comments

Comments
 (0)