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)); }
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)); }
public async Task <Either <DomainError, IImmutableList <InterestedStorage> > > GetAll() { return(await TableUtils.TryGetAllTableElements <InterestedStorage>(_tableClient)); }
public async Task <Either <DomainError, IImmutableList <string> > > GetProcessedTitles() { return(await TableUtils.TryGetAllTableElements <ProcessedTitlesStorage>(_tableClient).MapAsync(Map)); }