public async Task UpdateServer(ServerInfo.ServerInfoId serverId, ServerInfo server)
        {
            logger.ConditionalTrace("Update information about server {0}", server);

            await statisticStorage.UpdateServer(serverId, server);

            InsertServer(server);
        }
 public async Task <ServerInfo> GetServer(ServerInfo.ServerInfoId serverId)
 {
     using (var session = store.OpenAsyncSession())
     {
         return(await session
                .Query <ServerInfo, ServerById>()
                .Customize(q => q.WaitForNonStaleResults())
                .Where(s => s.Id == serverId.Id).SingleOrDefaultAsync());
     }
 }
        public async Task UpdateServer(ServerInfo.ServerInfoId serverId, ServerInfo server)
        {
            server.Id = serverId.Id;
            using (var session = store.OpenAsyncSession())
            {
                await session.StoreAsync(server);

                await session.SaveChangesAsync();
            }
        }
 public virtual void AddServer(ServerInfo.ServerInfoId serverId, ServerInfo server)
 {
     A.CallTo(() => storage.GetServer(serverId)).Returns(server);
 }
        public async Task <ServerInfo> GetServer(ServerInfo.ServerInfoId serverId)
        {
            logger.ConditionalTrace("Retrive information about server {0}", new { ServerId = serverId });

            return(await statisticStorage.GetServer(serverId));
        }