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

23 lines
728 B
C#
Raw Permalink Normal View History

2024-11-17 10:31:01 +01:00
namespace Galaeth.Core.Exceptions;
/// <summary>
/// Thrown if an entity has a property that has a primary key attribute, but no column attribute.
/// </summary>
public class MissingColumnAttributeException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="MissingColumnAttributeException"/> class.
/// </summary>
/// <param name="entityType">The entity causing the exception.</param>
public MissingColumnAttributeException(Type entityType)
: base($"Entity '{entityType}' primary key requires a ColumnMapping attribute")
{
EntityType = entityType;
}
/// <summary>
/// The entity type.
/// </summary>
public Type EntityType { get; set; }
}