shopping-assistant-api/ShoppingAssistantApi.Application/Exceptions/EntityAlreadyExistsException.cs
2023-09-22 23:02:20 +03:00

15 lines
609 B
C#

using ShoppingAssistantApi.Domain.Common;
namespace ShoppingAssistantApi.Application.Exceptions;
public class EntityAlreadyExistsException<TEntity> : Exception where TEntity : EntityBase
{
public EntityAlreadyExistsException()
: base($"\"{typeof(TEntity).Name}\" already exists.") { }
public EntityAlreadyExistsException(string message, Exception innerException)
: base(message, innerException) { }
public EntityAlreadyExistsException(string paramName, string paramValue)
: base($"\"{typeof(TEntity).Name}\" with {paramName}: \"{paramValue}\" already exists.") { }
}