Refactor SendAsync method in MessagingServiceClient
The `SendAsync` method in the `MessagingServiceClient` class has been refactored. It no longer uses the `async` keyword and instead directly returns the `Task` from `sender.Send`. This change simplifies the method by removing the `await` operation, while still maintaining asynchronous behavior through the returned `Task`.
This commit is contained in:
@@ -16,9 +16,9 @@ public class MessagingServiceClient(ISender sender)
|
|||||||
/// <param name="email"></param>
|
/// <param name="email"></param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task SendAsync(Email email, CancellationToken cancellationToken = default)
|
public Task SendAsync(Email email, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
await sender.Send(new PublishEmailViaSmtpCommand()
|
return sender.Send(new PublishEmailViaSmtpCommand()
|
||||||
{
|
{
|
||||||
Sender = new GetEmailAccountQuery()
|
Sender = new GetEmailAccountQuery()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user