23 lines
730 B
C#
23 lines
730 B
C#
namespace Galaeth.Core.Attributes.EntityAnnotation;
|
|
|
|
/// <summary>
|
|
/// Treat this property as the primary key in the database.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Property)]
|
|
public class PrimaryKeyAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="PrimaryKeyAttribute"/> class.
|
|
/// </summary>
|
|
/// <param name="autoGenerated">If the primary key auto-generated by the database.</param>
|
|
public PrimaryKeyAttribute(bool autoGenerated = false)
|
|
{
|
|
AutoGenerated = autoGenerated;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Should this primary key be auto-generated by the database? (i.e. Auto incrementing).
|
|
/// </summary>
|
|
public bool AutoGenerated { get; }
|
|
}
|