forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDbColumn.cs
More file actions
74 lines (69 loc) · 3.44 KB
/
DbColumn.cs
File metadata and controls
74 lines (69 loc) · 3.44 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#if NET461
using System;
#pragma warning disable 1591
#nullable disable
namespace Npgsql.Schema
{
/// <summary>
/// A copy of corefx's DbColumn, used only in .NET Framework where we don't have it.
/// </summary>
/// <remarks>
/// See https://github.com/dotnet/corefx/blob/master/src/System.Data.Common/src/System/Data/Common/DbColumn.cs
/// </remarks>
public abstract class DbColumn
{
// ReSharper disable once InconsistentNaming
public bool? AllowDBNull { get; protected set; }
public string BaseCatalogName { get; protected set; }
public string BaseColumnName { get; protected set; }
public string BaseSchemaName { get; protected set; }
public string BaseServerName { get; protected set; }
public string BaseTableName { get; protected set; }
public string ColumnName { get; protected set; }
public int? ColumnOrdinal { get; protected set; }
public int? ColumnSize { get; protected set; }
public bool? IsAliased { get; protected set; }
public bool? IsAutoIncrement { get; protected set; }
public bool? IsExpression { get; protected set; }
public bool? IsHidden { get; protected set; }
public bool? IsIdentity { get; protected set; }
public bool? IsKey { get; protected set; }
public bool? IsLong { get; protected set; }
public bool? IsReadOnly { get; protected set; }
public bool? IsUnique { get; protected set; }
public int? NumericPrecision { get; protected set; }
public int? NumericScale { get; protected set; }
public string UdtAssemblyQualifiedName { get; protected set; }
public Type DataType { get; protected set; }
public string DataTypeName { get; protected set; }
public virtual object this[string propertyName]
=> propertyName switch
{
nameof(AllowDBNull) => AllowDBNull,
nameof(BaseCatalogName) => BaseCatalogName,
nameof(BaseColumnName) => BaseColumnName,
nameof(BaseSchemaName) => BaseSchemaName,
nameof(BaseServerName) => BaseServerName,
nameof(BaseTableName) => BaseTableName,
nameof(ColumnName) => ColumnName,
nameof(ColumnOrdinal) => ColumnOrdinal,
nameof(ColumnSize) => ColumnSize,
nameof(IsAliased) => IsAliased,
nameof(IsAutoIncrement) => IsAutoIncrement,
nameof(IsExpression) => IsExpression,
nameof(IsHidden) => IsHidden,
nameof(IsIdentity) => IsIdentity,
nameof(IsKey) => IsKey,
nameof(IsLong) => IsLong,
nameof(IsReadOnly) => IsReadOnly,
nameof(IsUnique) => IsUnique,
nameof(NumericPrecision) => NumericPrecision,
nameof(NumericScale) => NumericScale,
nameof(UdtAssemblyQualifiedName) => UdtAssemblyQualifiedName,
nameof(DataType) => DataType,
nameof(DataTypeName) => DataTypeName,
_ => (object)null
};
}
}
#endif