示例#1
0
        public async Task <IEnumerable <Guid> > GetProductIds()
        {
            var result = await Task.Run(() => _tableStorageRepository.QueryAllAsync <ProductEntity>(TableReference)).ConfigureAwait(false);

            if (result != null)
            {
                return(result.Select(result => result.Id));
            }

            return(new List <Guid>());
        }
示例#2
0
        public async Task <IEnumerable <ProductQueryModel> > GetAllProducts()
        {
            var result = await Task.Run(() => _tableStorageRepository.QueryAllAsync <ProductEntity>(TableReference)).ConfigureAwait(false);

            if (result != null)
            {
                return(result.Select(r => new ProductQueryModel
                {
                    Id = r.Id,
                    IsActive = r.IsActive,
                    Name = r.Name,
                    Type = r.Type
                }));
            }

            return(new List <ProductQueryModel>());
        }