Ejemplo n.º 1
0
 public AccountService(IAccountCache cache, IAccountDatabase db)
 {
     _cache = cache;
     _db    = db;
     _db.GetAccountsOnce().ForEach(
         account => _cache.AddOrUpdate(account)
         );
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new authorization HTTP server class instance
 /// </summary>
 public AuthHttpServer(Version version, TAccountFactory accountFactory, IAccountDatabase <TAccount, TAccountFactory> accountDatabase, ILogger logger, string address) : base(logger, address)
 {
     this.version         = version ?? throw new ArgumentNullException();
     this.accountFactory  = accountFactory ?? throw new ArgumentNullException();
     this.accountDatabase = accountDatabase ?? throw new ArgumentNullException();
     listener.Prefixes.Add($"{address}{SignUpHttpRequest.Type}/");
     listener.Prefixes.Add($"{address}{SignInHttpRequest.Type}/");
 }
Ejemplo n.º 3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAccountDatabase accountDatabase)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }



            app.UseMvc();
            app.Run(async(context) => { await context.Response.WriteAsync($"Helloy World"); });
        }
Ejemplo n.º 4
0
 public BaseAccount(string accountName, IAccountDatabase storage, string NetworkId)
 {
     AccountName    = accountName;
     _storage       = storage; //new AccountDatabase();
     this.NetworkId = NetworkId;
 }
Ejemplo n.º 5
0
 public LoginController(IAccountDatabase db)
 {
     _db = db;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a new room HTTP server class instance
 /// </summary>
 public RoomHttpServer(Version version, RoomDictionary <TRoom, TAccount> rooms, TAccountFactory accountFactory, IAccountDatabase <TAccount, TAccountFactory> accountDatabase, ILogger logger, string address) : base(version, accountFactory, accountDatabase, logger, address)
 {
     this.rooms = rooms ?? throw new ArgumentNullException();
     listener.Prefixes.Add($"{address}{GetRoomInfosHttpRequest.Type}/");
     listener.Prefixes.Add($"{address}{JoinRoomHttpRequest.Type}/");
 }
Ejemplo n.º 7
0
 public ExchangeAccountWallet(IAccountDatabase storage, string NetworkId) : base(storage, NetworkId)
 {
 }
Ejemplo n.º 8
0
 public AccountService(IAccountCache cache, IAccountDatabase db)
 {
     _cache = cache;
     _db    = db;
 }
Ejemplo n.º 9
0
 protected BrokerWallet(IAccountDatabase storage, string name, ILyraAPI rpcClient = null)
     : base(storage, name, rpcClient)
 {
 }