public async Task <IActionResult> GetAll([FromQuery] string userId) { var watchLists = (await _watchListService.GetAllAsync(userId)) .Select(Mapper.Map <WatchList>); return(Ok(watchLists)); }
public void Is_AllAssets_Exists() { var lists = _watchListService.GetAllAsync(ClientId).Result; var allAsstsList = lists.FirstOrDefault(item => item.Name == "All assets"); Assert.IsNotNull(allAsstsList); Assert.IsTrue(allAsstsList.ReadOnly); }
public async Task <ResponseModel <List <MarginTradingWatchList> > > GetWatchLists() { var clientId = User.GetClaim(ClaimTypes.NameIdentifier); if (clientId == null) { return(ResponseModel <List <MarginTradingWatchList> > .CreateFail(ResponseModel.ErrorCodeType.NoAccess, "Wrong token")); } var result = new ResponseModel <List <MarginTradingWatchList> > { Result = await _watchListService.GetAllAsync(clientId) }; return(result); }
public async Task <ResponseModel <List <WatchListContract> > > GetWatchLists() { var clientId = User.GetClaim(AuthConsts.SubjectClaim); if (clientId == null) { return(ResponseModel <List <WatchListContract> > .CreateFail(ResponseModel.ErrorCodeType.NoAccess, "Wrong token")); } var result = new ResponseModel <List <WatchListContract> > { Result = Convert(await _watchListService.GetAllAsync(clientId)) }; return(result); }