26 lines
838 B
C#
26 lines
838 B
C#
// <copyright file="MultiplePrimaryKeysException.cs" company="alveus.dev">
|
|
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
|
|
// </copyright>
|
|
|
|
namespace Astral.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; }
|
|
}
|