Files
Umbraco-CMS/src/Umbraco.Infrastructure/Persistence/DatabaseAnnotations/IndexAttribute.cs
2019-12-12 08:11:23 +01:00

36 lines
988 B
C#

using System;
namespace Umbraco.Core.Persistence.DatabaseAnnotations
{
/// <summary>
/// Attribute that represents an Index
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class IndexAttribute : Attribute
{
public IndexAttribute(IndexTypes indexType)
{
IndexType = indexType;
}
/// <summary>
/// Gets or sets the name of the Index
/// </summary>
/// <remarks>
/// Overrides default naming of indexes:
/// IX_tableName
/// </remarks>
public string Name { get; set; }//Overrides default naming of indexes: IX_tableName
/// <summary>
/// Gets or sets the type of index to create
/// </summary>
public IndexTypes IndexType { get; private set; }
/// <summary>
/// Gets or sets the column name(s) for the current index
/// </summary>
public string ForColumns { get; set; }
}
}