///<summary> /// Create an InMemory Store that uses Microsoft.Extensions.DependencyInjection for a MemoryStore Instance ///</summary> public static IServiceCollection AddInMemoryInteraction(this IServiceCollection services) { services.AddSingleton <IInteract>(config => { IStorageModel model = config.GetRequiredService <IStorageModel>(); IAuthStorageModel authModel = config.GetRequiredService <IAuthStorageModel>(); return(new MemoryInteract(model, authModel)); }); return(services); }
} // null means Query public UserContext(AuthModel user, IStorageModel model, CommandTypes?type, IAuthStorageModel authStorage, params ApplicationClaim[] claims) : base(model) { string msg = $"ctor of UserContext for [{type.ToString()}]"; SanityChecks.CheckNull(model, msg); SanityChecks.CheckNull(user, msg); SanityChecks.CheckNull(authStorage, msg); Type = type; Claims = claims; AuthModel = user; AuthStorage = authStorage; }
public MemoryInteract(IStorageModel model, IAuthStorageModel authStorage) { _model = model; _authStorage = authStorage; }
public UserController(IStorageModel model, IAuthStorageModel authStore) { _model = model; _authStorageModel = authStore; }