예제 #1
0
        public async Task <RSU> GetAsync(ManagerUser managerUser, int id)
        {
            var host = GetHost(managerUser);

            try
            {
                var result = await _httpClinet.GetStringAsync($"http://{host}:{managerUser.Manager.Port}/{controller}/{managerUser.Name}/{managerUser.Token}/{id}");

                var rsu = RsuDto.FromJson(result);

                return(RSU.Parse(rsu, managerUser.Manager));
            }
            catch (HttpRequestException ex)
            {
                return(null);
            }
        }
예제 #2
0
        public async Task <IEnumerable <RSU> > GetAsync(ManagerUser managerUser)
        {
            var host = GetHost(managerUser);

            try
            {
                var result = await _httpClinet.GetStringAsync($"http://{host}:{managerUser.Manager.Port}/{controller}/{managerUser.Name}/{managerUser.Token}");

                var rsus = RsuDto.FromJsonCollection(result);


                return(rsus.Select(r => RSU.Parse(r, managerUser.Manager)).ToList());
            }
            catch (HttpRequestException ex)
            {
                return(null);
            }
        }