public async Task <ResponseModel> GetInfoAsync() { var foreignModel = new ForeignModel(); using (var client = new WebClient()) { while (url != null) { var nextContent = await client.DownloadStringTaskAsync(url); ForeignModel nextInfo = JsonConvert.DeserializeObject <ForeignModel>(nextContent); url = nextInfo.Next; foreignModel.Results.AddRange(nextInfo.Results); } foreignModel.Count = foreignModel.Results.Count; } var responseModel = _mapper.Map <ForeignModel, ResponseModel>(foreignModel); SetIndexField(responseModel); return(responseModel); }
public TeachModel(ForeignModel model) { this.Model = model; indexInSharedMemory = model.IndexInNationsSharedMemory; }