forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSortInfo.cs
More file actions
34 lines (29 loc) · 1004 Bytes
/
Copy pathSortInfo.cs
File metadata and controls
34 lines (29 loc) · 1004 Bytes
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
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace System.Web.Helpers
{
internal sealed class SortInfo : IEquatable<SortInfo>
{
public string SortColumn { get; set; }
public SortDirection SortDirection { get; set; }
public bool Equals(SortInfo other)
{
return other != null
&& String.Equals(SortColumn, other.SortColumn, StringComparison.OrdinalIgnoreCase)
&& SortDirection == other.SortDirection;
}
public override bool Equals(object obj)
{
SortInfo sortInfo = obj as SortInfo;
if (sortInfo != null)
{
return Equals(sortInfo);
}
return base.Equals(obj);
}
public override int GetHashCode()
{
return SortColumn.GetHashCode();
}
}
}