Exemplo n.º 1
0
        public async Task <IEnumerable <IRepositoryUpdateHistory> > GetAsync(Func <IRepositoryUpdateHistory, bool> filter)
        {
            var pk   = RepositoryUpdateHistory.GeneratePartitionKey();
            var list = await _tableStorage.GetDataAsync(pk, filter);

            return(list);
        }
Exemplo n.º 2
0
        public async Task <IRepositoryUpdateHistory> GetAsync(string repositoryUpdateHistoryId)
        {
            var pk = RepositoryUpdateHistory.GeneratePartitionKey();
            var rk = RepositoryUpdateHistory.GenerateRowKey(repositoryUpdateHistoryId);

            return(await _tableStorage.GetDataAsync(pk, rk));
        }
Exemplo n.º 3
0
        public async Task SaveRepositoryUpdateHistory(IRepositoryUpdateHistory entity)
        {
            if (!(entity is RepositoryUpdateHistory ruh))
            {
                ruh = (RepositoryUpdateHistory) await GetAsync(entity.RowKey) ?? new RepositoryUpdateHistory();

                ruh.ETag          = entity.ETag;
                ruh.InitialCommit = entity.InitialCommit;
                ruh.User          = entity.User;
                ruh.Branch        = entity.Branch;
                ruh.IsManual      = entity.IsManual;
                ruh.CreatedAt     = DateTime.UtcNow;
            }

            if (ruh.CreatedAt == null)
            {
                ruh.CreatedAt = ruh.Timestamp;
            }
            ruh.PartitionKey = RepositoryUpdateHistory.GeneratePartitionKey();
            ruh.RowKey       = entity.RowKey;
            await _tableStorage.InsertOrMergeAsync(ruh);
        }
Exemplo n.º 4
0
        public async Task <IEnumerable <IRepositoryUpdateHistory> > GetAsyncByInitialCommit(string initialCommit)
        {
            string partitionFilter  = TableQuery.GenerateFilterCondition(nameof(RepositoryUpdateHistory.PartitionKey), QueryComparisons.Equal, RepositoryUpdateHistory.GeneratePartitionKey());
            string repositoryFilter = TableQuery.GenerateFilterCondition(nameof(RepositoryUpdateHistory.InitialCommit), QueryComparisons.Equal, initialCommit);
            string queryText        = TableQuery.CombineFilters(partitionFilter, TableOperators.And, repositoryFilter);
            var    query            = new TableQuery <RepositoryUpdateHistory>().Where(queryText);

            return(await _tableStorage.WhereAsync(query));
        }
Exemplo n.º 5
0
 public async Task RemoveRepositoryUpdateHistoryAsync(string repositoryUpdateHistoryId)
 {
     var pk = RepositoryUpdateHistory.GeneratePartitionKey();
     var rk = RepositoryUpdateHistory.GenerateRowKey(repositoryUpdateHistoryId);
     await _tableStorage.DeleteAsync(pk, rk);
 }
Exemplo n.º 6
0
        public async Task <IEnumerable <IRepositoryUpdateHistory> > GetAllAsync()
        {
            var pk = RepositoryUpdateHistory.GeneratePartitionKey();

            return(await _tableStorage.GetDataAsync(pk));
        }