public async Task <int> IndexWorkRootAsync( WorkRoot workRoot, Action <string>?onProgress = null, CancellationToken cancellationToken = default) { using IBoostDbContext dbContext = _dbContextFactory.Open(DbOpenMode.ReadWrite); IEnumerable <IConnectedService> connectedServices = await _connectedServiceManager .GetServicesAsync(cancellationToken); ClearIndex(workRoot.Name); int indexCount = 0; foreach (DirectoryInfo?dir in new DirectoryInfo(workRoot.Path) .GetDirectories()) { AddToIndex(workRoot, dir.FullName, connectedServices, dbContext); GitRepositoryIndex?repoIndex = Index(dir.FullName); onProgress?.Invoke(dir.FullName); indexCount++; } return(indexCount); }
public IEnumerable <GitLocalRepository> Search( string?term) { IEnumerable <GitRepositoryIndex> repos; using IBoostDbContext dbContext = _dbContextFactory.Open(DbOpenMode.ReadOnly); if (term is { })
public Task <IdentityRequestItem> SaveAsync( SaveIdentityRequestInput request, CancellationToken cancellationToken) { IdentityRequestItem toSave = new IdentityRequestItem(); using IBoostDbContext dbContext = _dbContextFactory.Open(DbOpenMode.ReadWrite); if (request.Id.HasValue) { IdentityRequestItem?existing = dbContext.IdentityRequest .FindById(request.Id.Value); if (existing is { })