public async Task <IActionResult> GetAll([FromQuery] string userId)
        {
            var watchLists = (await _watchListService.GetAllAsync(userId))
                             .Select(Mapper.Map <WatchList>);

            return(Ok(watchLists));
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }