Files
BackOffice.BFF/src/BackOffice.BFF.Application/Common/Exceptions/DuplicateException.cs
T
2025-09-28 15:24:13 +03:30

30 lines
665 B
C#

namespace BackOffice.BFF.Application.Common.Exceptions;
public class DuplicateException : Exception
{
public DuplicateException()
: base()
{
}
public DuplicateException(string message)
: base(message)
{
}
public DuplicateException(string message, Exception innerException)
: base(message, innerException)
{
}
public DuplicateException(string name, object key)
: base($"Entity \"{name}\" ({key}) already exists.")
{
}
public DuplicateException(string name, string field, object? key)
: base($"Entity \"{name}\" field \"{field}\" ({key}) already exists.")
{
}
}