updating countries

This commit is contained in:
2024-08-20 21:34:56 +03:00
parent 19e792e670
commit a0d002b465
14 changed files with 119 additions and 10 deletions

View File

@@ -0,0 +1,9 @@
using Domains;
namespace Infrastructure.Database.GeneralExceptions;
/// Exception to throw when entity not found
/// <param name="id">Identifier of entity</param>
/// <typeparam name="T">Type of entity</typeparam>
public class EntityNotFoundByIdException<T>(Guid id) : EntityNotFoundException<T>($"{typeof(T).Name} with id {id} not found.")
where T : class, IEntity;

View File

@@ -0,0 +1,9 @@
using ApplicationLayer.GeneralExceptions;
using Domains;
namespace Infrastructure.Database.GeneralExceptions;
/// Exception to throw when entity not found
/// <typeparam name="T">Not found entity type</typeparam>
public class EntityNotFoundException<T>(string message) : ApiException(message)
where T : class, IEntity;

View File

@@ -0,0 +1,7 @@
using ApplicationLayer.GeneralExceptions;
namespace Infrastructure.Database.GeneralExceptions
{
/// Exception to throw when can't complete some action on entity(delete or something) because it's needed for other entities
public class EntityUsedInDatabaseException(string message) : ApiException(message);
}