-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDatabaseObjectInfo.cs
More file actions
72 lines (63 loc) · 1.81 KB
/
DatabaseObjectInfo.cs
File metadata and controls
72 lines (63 loc) · 1.81 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
namespace DB_Schema_Export_Tool
{
internal class DatabaseObjectInfo
{
/// <summary>
/// Object Schema
/// </summary>
public string Schema { get; set; }
/// <summary>
/// Object name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Object type
/// </summary>
public string Type { get; set; }
/// <summary>
/// Object owner
/// </summary>
public string Owner { get; set; }
/// <summary>
/// Constructor
/// </summary>
public DatabaseObjectInfo()
{
Clear();
}
/// <summary>
/// Constructor that accepts name and type
/// </summary>
/// <param name="objectName">Object name</param>
/// <param name="objectType">Object type</param>
public DatabaseObjectInfo(string objectName, string objectType)
{
Clear();
Name = objectName;
Type = objectType;
Owner = string.Empty;
}
/// <summary>
/// Reset all properties to empty strings
/// </summary>
public void Clear()
{
Schema = string.Empty;
Name = string.Empty;
Type = string.Empty;
Owner = string.Empty;
}
public override string ToString()
{
if (string.IsNullOrWhiteSpace(Type))
{
if (string.IsNullOrWhiteSpace(Schema))
{
return Name;
}
return string.Format("{0}.{1}", Schema, Name);
}
return string.Format("{0}: {1}.{2}", Type, Schema, Name);
}
}
}