-
Notifications
You must be signed in to change notification settings - Fork 4
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
9 changed files
with
73 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
namespace Miru.Domain | ||
namespace Miru.Domain; | ||
|
||
public class NotFoundException : DomainException | ||
{ | ||
public class NotFoundException : DomainException | ||
public NotFoundException(string message) : base(message) | ||
{ | ||
public NotFoundException(string message) : base(message) | ||
{ | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Miru.Domain; | ||
|
||
namespace Miru; | ||
|
||
public static class EnumerableExtensions | ||
{ | ||
public static T SingleOrFail<T>(this IEnumerable<T> enumerable, string exceptionMessage) | ||
{ | ||
return enumerable.SingleOrDefault() ?? throw new NotFoundException(exceptionMessage); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using System; | ||
using MediatR; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Miru.Pipeline; | ||
|
||
|
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,15 @@ | ||
using MediatR; | ||
|
||
namespace Miru.Queuing; | ||
|
||
public static class JobsExtensions | ||
{ | ||
public static void EnqueueIn<TJob>( | ||
this Jobs jobs, | ||
TimeSpan startIn, | ||
TJob job, | ||
string queue = "default") where TJob : IBaseRequest | ||
{ | ||
jobs.Enqueue(job, startIn: startIn, queue); | ||
} | ||
} |