-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathQueryStringParameterExtensionMethods.cs
40 lines (37 loc) · 1.22 KB
/
QueryStringParameterExtensionMethods.cs
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
namespace SparkyTestHelpers.AspNetMvc
{
/// <summary>
/// Simple query string parameter key/value struct.
/// </summary>
public struct QueryStringParameter
{
/// <summary>
/// Query string parameter name.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Query string parameter value.
/// </summary>
public string Value { get; set; }
/// <summary>
/// Creates a new <see cref="QueryStringParameter" instance.
/// </summary>
/// <param name="name"><see cref="Name" /> value.</param>
/// <param name="value"><see cref="Value" /> value.</param>
public QueryStringParameter(string name, string value)
{
Name = name;
Value = value;
}
/// <summary>
/// Creates a new <see cref="QueryStringParameter" instance.
/// </summary>
/// <param name="name"><see cref="Name" /> value.</param>
/// <param name="value"><see cref="Value" /> value.</param>
public QueryStringParameter(string name, object value)
{
Name = name;
Value = (value is null) ? null : value.ToString();
}
}
}