2020-03-23 11:57:07 +01:00
|
|
|
using System;
|
|
|
|
|
|
2020-03-24 23:09:29 +01:00
|
|
|
namespace zero.Core.Attributes
|
2020-03-23 11:57:07 +01:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Automatically generate ID with the specified length and insert it into this property on entity save
|
|
|
|
|
/// </summary>
|
|
|
|
|
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
|
|
|
|
public class GenerateIdAttribute : Attribute
|
|
|
|
|
{
|
|
|
|
|
public int? Length = null;
|
|
|
|
|
|
|
|
|
|
public GenerateIdAttribute(int length)
|
|
|
|
|
{
|
|
|
|
|
Length = length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GenerateIdAttribute() { }
|
|
|
|
|
}
|
|
|
|
|
}
|