forked from SamSaffron/MiniProfiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIStorage.cs
More file actions
47 lines (41 loc) · 1.74 KB
/
IStorage.cs
File metadata and controls
47 lines (41 loc) · 1.74 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace StackExchange.Profiling.Storage
{
/// <summary>
/// Provides saving and loading <see cref="MiniProfiler"/>s to a storage medium.
/// </summary>
public interface IStorage
{
/// <summary>
/// Stores <paramref name="profiler"/> under its <see cref="MiniProfiler.Id"/>.
/// </summary>
/// <param name="profiler">The results of a profiling session.</param>
/// <remarks>
/// Should also ensure the profiler is stored as being unviewed by its profiling <see cref="MiniProfiler.User"/>.
/// </remarks>
void Save(MiniProfiler profiler);
/// <summary>
/// Returns a <see cref="MiniProfiler"/> from storage based on <paramref name="id"/>, which should map to <see cref="MiniProfiler.Id"/>.
/// </summary>
/// <remarks>
/// Should also update that the resulting profiler has been marked as viewed by its profiling <see cref="MiniProfiler.User"/>.
/// </remarks>
MiniProfiler Load(Guid id);
/// <summary>
/// Sets a particular profiler session so it is considered "unviewed"
/// </summary>
void SetUnviewed(string user, Guid id);
/// <summary>
/// Sets a particular profiler session to "viewed"
/// </summary>
void SetViewed(string user, Guid id);
/// <summary>
/// Returns a list of <see cref="MiniProfiler.Id"/>s that haven't been seen by <paramref name="user"/>.
/// </summary>
/// <param name="user">User identified by the current <see cref="MiniProfiler.Settings.UserProvider"/>.</param>
List<Guid> GetUnviewedIds(string user);
}
}