Class JsonSessionStorage
Namespace: XboxAuthNet.Game.SessionStorages
Assembly: XboxAuthNet.Game.dll
public class JsonSessionStorage : ISessionStorage
Inheritance
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Extension Methods
Extensions.GetKeysForStoring(ISessionStorage)
Constructors
JsonSessionStorage(JsonObject, JsonSerializerOptions?)
public JsonSessionStorage(JsonObject json, JsonSerializerOptions? jsonSerializerOptions = null)
Parameters
json JsonObject
jsonSerializerOptions JsonSerializerOptions?
Properties
Keys
public IEnumerable<string> Keys { get; }
Property Value
Methods
Clear()
public void Clear()
ContainsKey(string)
public bool ContainsKey(string key)
Parameters
key string
Returns
ContainsKey<T>(string)
public bool ContainsKey<T>(string key)
Parameters
key string
Returns
Type Parameters
T
CreateEmpty(JsonSerializerOptions?)
public static JsonSessionStorage CreateEmpty(JsonSerializerOptions? jsonOptions = null)
Parameters
jsonOptions JsonSerializerOptions?
Returns
Get<T>(string)
public T Get<T>(string key)
Parameters
key string
Returns
T
Type Parameters
T
GetKeyMode(string)
public SessionStorageKeyMode GetKeyMode(string key)
Parameters
key string
Returns
GetOrDefault<T>(string, T)
public T GetOrDefault<T>(string key, T defaultValue)
Parameters
key string
defaultValue T
Returns
T
Type Parameters
T
Remove(string)
public bool Remove(string key)
Parameters
key string
Returns
Set<T>(string, T)
public void Set<T>(string key, T obj)
Parameters
key string
obj T
Type Parameters
T
SetKeyMode(string, SessionStorageKeyMode)
public void SetKeyMode(string key, SessionStorageKeyMode mode)
Parameters
key string
ToJsonObject()
public JsonObject ToJsonObject()
Returns
ToJsonObjectByKeys(IEnumerable<string>)
public JsonObject ToJsonObjectByKeys(IEnumerable<string> keys)
Parameters
keys IEnumerable<string>
Returns
ToJsonObjectForStoring()
public JsonObject ToJsonObjectForStoring()
Returns
TryGetValue<T>(string, out T)
public bool TryGetValue<T>(string key, out T value)
Parameters
key string
value T
Returns
Type Parameters
T