Esempio n. 1
0
        public async Task <IActionResult> GetBaseAsset()
        {
            var baResp = await _clientAccountSettingsClient.GetBaseAssetAsync(_requestContext.ClientId);

            var baseAssetModel = new BaseAssetModel
            {
                BaseAssetId = baResp.BaseAssetId
            };

            return(Ok(baseAssetModel));
        }
Esempio n. 2
0
        public async Task <Asset> GetBaseAssetForClient(string clientId, bool isIosDevice, string partnerId)
        {
            var baseAsset = (await _clientAccountSettingsClient.GetBaseAssetAsync(clientId)).BaseAssetId;

            if (string.IsNullOrEmpty(baseAsset))
            {
                var assetsForClient = (await GetAssetsForClient(clientId, isIosDevice, partnerId)).Where(x => x.IsBase);

                baseAsset = assetsForClient.GetFirstAssetId();
            }

            return(await _cachedAssetsDictionary.GetItemAsync(baseAsset));
        }
Esempio n. 3
0
        public async Task <IActionResult> GetBaseAsset()
        {
            BaseAssetClientModel response;

            try
            {
                response = await _clientAccountSettingsClient.GetBaseAssetAsync(_requestContext.ClientId);
            }
            catch (Exception e)
            {
                await _log.WriteFatalErrorAsync(nameof(AssetsController), nameof(GetBaseAsset), e);

                return(BadRequest(new { message = e.Message }));
            }

            return(Ok(response));
        }