protected override void BeforeGetUser(string user_id) { if (!this.storeProvider.Exists(user_id)) { PersistentUser user = new PersistentUser(new User()); this.storeProvider.Store(user_id, user); this.storeProvider.Persist(); } }
protected override IUser GetUser(string user_id) { PersistentUser user = this.storeProvider.Get <PersistentUser>(user_id); return(new User(user)); }
public User(PersistentUser persistentUser) { var history_list = persistentUser.HistoryEntries.ToDictionary(x => x.Id, x => x); this.history = new ConcurrentDictionary <string, UserHistoryEntry>(history_list); }