Exemple #1
0
        private static int List(ListOptions listOptions, Service.InSync.InSyncClient client)
        {
            var request = new ListSyncRequest();

            var result = client.ListSync(request);

            result.Watches
            .ToList()
            .ForEach(x => Console.WriteLine($"{x.SourcePath} => {x.TargetPath}"));
            return(0);
        }
Exemple #2
0
        public override async Task <ListSyncResponse> ListSync(ListSyncRequest request, ServerCallContext context)
        {
            using var unitOfWork = _unitOfWorkFactory.Create();
            var watches = await _syncService.GetWatchesAsync(unitOfWork);

            await unitOfWork.CommitAsync();

            return(new ListSyncResponse
            {
                Result = ErrorCode.Ok,
                Watches =
                {
                    watches.Select(x => new Sync
                    {
                        SourcePath = x.SourcePath,
                        TargetPath = x.TargetPath
                    })
                }
            });
        }