Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
108 lines (95 loc) · 3.56 KB

File metadata and controls

108 lines (95 loc) · 3.56 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Simple.Data.Ado.Schema;
namespace Simple.Data.Ado
{
public class ObjectName : IEquatable<ObjectName>
{
private readonly string _schema;
private readonly string _name;
private readonly string _alias;
public ObjectName(object schema, object name)
{
if (name == null) throw new ArgumentNullException("name");
_schema = schema != null && schema != DBNull.Value ? (string)schema : null;
_name = (string)name;
}
public ObjectName(string schema, string name) : this(schema, name, null)
{
}
public ObjectName(string schema, string name, string alias)
{
if (name == null) throw new ArgumentNullException("name");
_schema = schema;
_name = name;
_alias = alias;
}
public string Alias
{
get { return _alias; }
}
public string Name
{
get { return _name; }
}
public string Schema
{
get { return _schema; }
}
/// <summary>
/// Indicates whether the current object is equal to another object of the same type.
/// </summary>
/// <returns>
/// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
/// </returns>
/// <param name="other">An object to compare with this object.</param>
public bool Equals(ObjectName other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(other._schema, _schema) && Equals(other._name, _name);
}
/// <summary>
/// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
/// </returns>
/// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != typeof (ObjectName)) return false;
return Equals((ObjectName) obj);
}
/// <summary>
/// Serves as a hash function for a particular type.
/// </summary>
/// <returns>
/// A hash code for the current <see cref="T:System.Object"/>.
/// </returns>
/// <filterpriority>2</filterpriority>
public override int GetHashCode()
{
unchecked
{
return ((_schema??string.Empty).GetHashCode()*397) ^ _name.GetHashCode();
}
}
public static bool operator ==(ObjectName left, ObjectName right)
{
return Equals(left, right);
}
public static bool operator !=(ObjectName left, ObjectName right)
{
return !Equals(left, right);
}
public override string ToString()
{
return _schema == null ? _name : _schema + "." + _name;
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.