-
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.
- Loading branch information
Showing
39 changed files
with
1,228 additions
and
581 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace TravelBlog.Database.Entities; | ||
|
||
public class OutboxEmail | ||
{ | ||
public int Id { get; set; } | ||
|
||
public int? BlogPostId { get; set; } | ||
public BlogPost? BlogPost { get; set; } | ||
|
||
public required string EmailAddress { get; set; } | ||
public required byte[] Content { get; set; } | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
|
||
namespace TravelBlog.Database.Entities; | ||
|
||
public class SentEmail | ||
{ | ||
public int Id { get; set; } | ||
|
||
public int? BlogPostId { get; set; } | ||
public BlogPost? BlogPost { get; set; } | ||
|
||
public required string EmailAddress { get; set; } | ||
public required int ContentSize { get; set; } | ||
public string? ErrorMessage { get; set; } | ||
public required DateTime DeliveryTime { get; set; } | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Nito.AsyncEx; | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
using System; | ||
|
||
namespace TravelBlog.Extensions; | ||
|
||
public static class AsyncExtensions | ||
{ | ||
// Inspired by https://github.com/StephenCleary/AsyncEx/issues/212#issuecomment-653765593 | ||
public static async Task<bool> WaitAsync(this AsyncAutoResetEvent mEvent, TimeSpan timeout, CancellationToken token = default) | ||
{ | ||
using var timeOut = new CancellationTokenSource(timeout); | ||
using var combined = CancellationTokenSource.CreateLinkedTokenSource(timeOut.Token, token); | ||
|
||
try | ||
{ | ||
await mEvent.WaitAsync(combined.Token).ConfigureAwait(false); | ||
return true; | ||
} | ||
// Don't catch the OperationCanceledException from external Token | ||
catch (OperationCanceledException) when (!token.IsCancellationRequested) | ||
{ | ||
return false; //Here the OperationCanceledException was raised by Timeout | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: SuppressMessage("Style", "IDE0290:Use primary constructor", Justification = "Primary constructors do not support readonly values in .NET 8.0")] |
Oops, something went wrong.