예제 #1
0
        public async Task <Either <DomainError, IImmutableList <InterestedStorage> > > Get(Email userEmail)
        {
            var user       = OptionUtils.UnpackOption(userEmail.Value, string.Empty);
            var tableQuery = new TableQuery <InterestedStorage>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, user));

            return(await TableUtils.TryGetAllTableElements(_tableClient, tableQuery));
        }
예제 #2
0
        public Task <Either <DomainError, Unit> > RemoveExpired()
        {
            var filterByPartition = TableQuery.GenerateFilterCondition("PartitionKey",
                                                                       QueryComparisons.Equal, "feed-processed");

            var filterByDate = TableQuery.GenerateFilterConditionForDate("Timestamp",
                                                                         QueryComparisons.LessThanOrEqual, DateTimeOffset.Now);

            var queryFilter = TableQuery.CombineFilters(filterByPartition, TableOperators.And, filterByDate);
            var tableQuery  = new TableQuery <ProcessedTitlesStorage>().Where(queryFilter);
            var result      = TableUtils.TryGetAllTableElements(_tableClient, tableQuery);

            return(result.BindAsync(BatchDelete));
        }
예제 #3
0
 public async Task <Either <DomainError, IImmutableList <InterestedStorage> > > GetAll()
 {
     return(await TableUtils.TryGetAllTableElements <InterestedStorage>(_tableClient));
 }
예제 #4
0
 public async Task <Either <DomainError, IImmutableList <string> > > GetProcessedTitles()
 {
     return(await TableUtils.TryGetAllTableElements <ProcessedTitlesStorage>(_tableClient).MapAsync(Map));
 }