18 lines
417 B
C#
18 lines
417 B
C#
|
|
namespace zero.Persistence;
|
||
|
|
|
||
|
|
/// <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() { }
|
||
|
|
}
|