-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathUserStoreTest.cs
More file actions
38 lines (34 loc) · 957 Bytes
/
UserStoreTest.cs
File metadata and controls
38 lines (34 loc) · 957 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
35
36
37
38
using System;
using System.Collections.Generic;
using SitePlugin;
namespace Common
{
public class UserStoreTest : IUserStore
{
public event EventHandler<IUser> UserAdded;
System.Collections.Concurrent.ConcurrentDictionary<string, IUser> _dict = new System.Collections.Concurrent.ConcurrentDictionary<string, IUser>();
public IUser GetUser(string userid)
{
if (!_dict.TryGetValue(userid, out IUser user))
{
user = new UserTest(userid);
_dict.AddOrUpdate(userid, user, (_, u) => u);
}
return user;
}
public void Init()
{
}
public void Update(IUser user)
{
throw new NotImplementedException();
}
public void Save()
{
}
public IEnumerable<IUser> GetAllUsers()
{
return new List<IUser>();
}
}
}