2012-10-12 12:37:55 -02:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Persistence.DatabaseAnnotations
|
|
|
|
|
|
{
|
2012-10-23 08:09:01 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Attribute that represents a Foreign Key reference
|
|
|
|
|
|
/// </summary>
|
2012-10-18 11:49:44 -02:00
|
|
|
|
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
|
2012-10-12 12:37:55 -02:00
|
|
|
|
public class ForeignKeyAttribute : ReferencesAttribute
|
|
|
|
|
|
{
|
|
|
|
|
|
public ForeignKeyAttribute(Type type) : base(type)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2012-10-23 08:09:01 -02:00
|
|
|
|
internal string OnDelete { get; set; }
|
|
|
|
|
|
internal string OnUpdate { get; set; }
|
2012-10-12 12:37:55 -02:00
|
|
|
|
|
2012-10-23 08:09:01 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the name of the foreign key refence
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// Overrides the default naming of a foreign key reference:
|
|
|
|
|
|
/// FK_thisTableName_refTableName
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the name of the Column that this foreign key should reference.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>PrimaryKey column is used by default</remarks>
|
|
|
|
|
|
public string Column { get; set; }
|
2012-10-12 12:37:55 -02:00
|
|
|
|
}
|
|
|
|
|
|
}
|