Example #1
0
 public UpdateServiceCore(ILogger <UpdateServiceCore> logger, IConfigurationProvider configurationProvider)
 {
     _logger     = logger;
     _updatePath = configurationProvider.ClientAppFolderPath;
     _updateInfo = ReadUpdateInfo();
     _logger.LogInformation("Update uploader initialized");
 }
Example #2
0
        private ClientUpdateInfo ReadUpdateInfo()
        {
            ClientUpdateInfo result = new ClientUpdateInfo();

            _filesList        = Directory.GetFiles(_updatePath).ToList().Select(Path.GetFileName).ToList();
            result.FilesCount = _filesList.Count;
            result.Size       = 0;
            return(result);
        }
        protected new void AddToResponse(string path, object instance, Func <object, object> toDtoMethod = null)
        {
            var entry = new ClientUpdateInfo
            {
                Instance     = instance,
                DtoConverter = toDtoMethod,
                Order        = ClientResponseIndex++
            };

            if (_clientData.ContainsKey(path))
            {
                _clientData[path] = entry;
            }
            else
            {
                _clientData.Add(path, entry);
            }
        }