mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Working on the UserRepository functionality
+ Tests + QueryableExtensions. It is an add-on that allows you to implement exceptions if the returned List would be empty.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
namespace Govor.Data.Repositories.Exceptions;
|
||||
|
||||
public class NotFoundByKeyException<T> : NotFoundException
|
||||
{
|
||||
public NotFoundByKeyException(T key)
|
||||
: base($"Not found object by {key}"){}
|
||||
|
||||
public NotFoundByKeyException(T id, string message)
|
||||
: base($"Not found object by {id}. Message: " + message) {}
|
||||
|
||||
public NotFoundByKeyException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Govor.Core;
|
||||
|
||||
namespace Govor.Data.Repositories.Exceptions;
|
||||
|
||||
public class NotFoundException : GovorCoreException
|
||||
{
|
||||
public NotFoundException(string message)
|
||||
: base(message) {}
|
||||
public NotFoundException(string message, Exception innerException)
|
||||
: base(message, innerException){}
|
||||
}
|
||||
Reference in New Issue
Block a user