示例#1
0
        public async Task <IMarkup> SetAsync(IMarkup markup)
        {
            MarkupEntity entity = MarkupEntity.ByAssetPair.Create(markup);

            await _tableStorage.InsertOrReplaceAsync(entity);

            AzureIndex index = MarkupEntity.IndexByIdentity.Create(entity);

            await _indexByIdentity.InsertOrReplaceAsync(index);

            return(Mapper.Map <Core.Domain.Markup.Markup>(entity));
        }
示例#2
0
        public async Task <IMarkup> GetByIdentityAsync(MarkupIdentityType identityType, string identity, string assetPairId)
        {
            AzureIndex index = await _indexByIdentity.GetDataAsync(
                MarkupEntity.IndexByIdentity.GeneratePartitionKey(identityType, identity),
                MarkupEntity.IndexByIdentity.GenerateRowKey(assetPairId));

            if (index == null)
            {
                return(null);
            }

            MarkupEntity entity = await _tableStorage.GetDataAsync(index);

            return(Mapper.Map <Core.Domain.Markup.Markup>(entity));
        }