galaeth-draft/Galaeth.Core/Exceptions/MultiplePrimaryKeysException.cs
2024-11-17 09:31:01 +00:00

23 lines
664 B
C#

namespace Galaeth.Core.Exceptions;
/// <summary>
/// Thrown if an entity has multiple primary keys defined.
/// </summary>
public class MultiplePrimaryKeysException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="MultiplePrimaryKeysException"/> class.
/// </summary>
/// <param name="entityType">The entity causing the exception.</param>
public MultiplePrimaryKeysException(Type entityType)
: base($"Entity '{entityType}' contains multiple primary keys")
{
EntityType = entityType;
}
/// <summary>
/// The entity type.
/// </summary>
public Type EntityType { get; set; }
}