14 lines
665 B
C#
14 lines
665 B
C#
namespace Prefab.Catalog.Domain.Exceptions;
|
|
|
|
/// <summary>
|
|
/// Represents an exception that is thrown when an attempt is made to create or add an entity with a name that already
|
|
/// exists for the specified type.
|
|
/// </summary>
|
|
/// <param name="name">The name of the entity that caused the duplication error. Cannot be null.</param>
|
|
/// <param name="type">The type of the entity for which the duplicate name was detected. Cannot be null.</param>
|
|
internal class DuplicateNameException(string name, string type) : DomainException($"A {type} with the name {name} already exists.")
|
|
{
|
|
public string Name { get; } = name;
|
|
|
|
public string Type { get; } = type;
|
|
} |