generated from Avanade/avanade-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathPostgresDatabaseColumns.cs
More file actions
40 lines (34 loc) · 1.7 KB
/
PostgresDatabaseColumns.cs
File metadata and controls
40 lines (34 loc) · 1.7 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
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx
using CoreEx.Database.Extended;
using CoreEx.Entities;
namespace CoreEx.Database.Postgres
{
/// <summary>
/// Extends the <see cref="DatabaseColumns"/> adding additional SQL Server specific.
/// </summary>
/// <remarks>Overrides the <see cref="DatabaseColumns.RowVersionName"/> to '<c>xmin</c>'. This is a PostgreSQL system column (hidden); see <see href="https://www.postgresql.org/docs/current/ddl-system-columns.html#DDL-SYSTEM-COLUMNS"/>
/// and <see href="https://www.npgsql.org/efcore/modeling/concurrency.html"/> for more information.</remarks>
public class PostgresDatabaseColumns : DatabaseColumns
{
/// <summary>
/// Gets or sets the session context '<c>Username</c>' column name.
/// </summary>
public string SessionContextUsernameName { get; set; } = "Username";
/// <summary>
/// Gets or sets the session context '<c>Timestamp</c>' column name.
/// </summary>
public string SessionContextTimestampName { get; set; } = "Timestamp";
/// <summary>
/// Gets or sets the <see cref="ITenantId.TenantId"/> column name.
/// </summary>
public string SessionContextTenantIdName { get; set; } = "TenantId";
/// <summary>
/// Gets or sets the session context '<c>UserId</c>' column name.
/// </summary>
public string SessionContextUserIdName { get; set; } = "UserId";
/// <summary>
/// Initializes a new instance of the <see cref="PostgresDatabaseColumns"/> class.
/// </summary>
public PostgresDatabaseColumns() => RowVersionName = "xmin";
}
}