-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIRequestCookieCollection.cs
44 lines (42 loc) · 2.01 KB
/
IRequestCookieCollection.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
41
42
43
44
using System.Collections.Generic;
namespace Inversion.Web
{
/// <summary>
/// Describes a collection of request cookies.
/// </summary>
public interface IRequestCookieCollection : IEnumerable<KeyValuePair<string, string>>
{
/// <summary>
/// Provides access to request cookies by key index.
/// </summary>
/// <param name="key">The key of the cookie.</param>
/// <returns>Returns the cookie under the specified key.</returns>
string this[string key] { get; }
/// <summary>
/// Gets the value of the cookie of the specified key.
/// </summary>
/// <param name="key">The key of the cookie.</param>
/// <returns>Returns the value of the cookie under the specified key.</returns>
string Get(string key);
/// <summary>
/// Tries to get the value of the cookie of the specified key.
/// </summary>
/// <param name="key">The key of the cookie.</param>
/// <param name="value">The string reference any found cookie value should be assigned to.</param>
/// <returns>Returns true if the specified cookie was found; otherwise, returns false.</returns>
bool TryGetValue(string key, out string value);
/// <summary>
/// Get the list of cookie contents as a dictionary.
/// </summary>
/// <param name="key">The cookie key</param>
/// <returns>Returns a dictionary representation of the cookie contents (name=value style).</returns>
IDictionary<string, string> GetValues(string key);
/// <summary>
/// Tries to get the list of cookie contents as a dictionary.
/// </summary>
/// <param name="key">The cookie key</param>
/// <param name="values">The dictionary reference that will have the result assigned to.</param>
/// <returns>Returns true if the specified cookie was found; otherwise, returns false.</returns>
bool TryGetValues(string key, out IDictionary<string, string> values);
}
}