galaeth-draft/Galaeth.Core/Exceptions/MultiplePrimaryKeysException.cs

23 lines
664 B
C#
Raw Normal View History

2024-11-17 10:31:01 +01:00
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; }
}