blob: c31a13e6e498a7b992bb1f61a489a9d467c98ea9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
namespace CrupestApi.Commons.Crud;
public interface IColumnMetadata
{
}
public enum ColumnIndexType
{
None,
Unique,
NonUnique
}
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class ColumnAttribute : Attribute, IColumnMetadata
{
// if null, use the property name.
public string? DatabaseName { get; set; }
// default false.
public bool NonNullable { get; set; }
// default false
public bool IsPrimaryKey { get; set; }
// default false
public bool IsAutoIncrement { get; set; }
public ColumnIndexType IndexType { get; set; } = ColumnIndexType.None;
// Use empty string for default value of string type.
public bool DefaultEmptyForString { get; set; }
}
|