Ejemplo n.º 1
0
        public async Task Post(AddSyncTarget request)
        {
            var accessToken = await GetAccessToken(request.Code).ConfigureAwait(false);

            var syncAccount = new DropboxSyncAccount
            {
                Id   = Guid.NewGuid().ToString(),
                Name = WebUtility.UrlDecode(request.Name),
                EnableForEveryone = request.EnableForEveryone,
                UserIds           = request.UserIds,
                AccessToken       = accessToken
            };

            if (!string.IsNullOrEmpty(request.Id))
            {
                syncAccount.Id = request.Id;
            }

            _configurationRetriever.AddSyncAccount(syncAccount);
        }
        public async Task Post(AddSyncTarget request)
        {
            var accessToken = await GetAccessToken(request.Code);

            var syncAccount = new DropboxSyncAccount
            {
                Id = Guid.NewGuid().ToString(),
                Name = WebUtility.UrlDecode(request.Name),
                EnableForEveryone = request.EnableForEveryone,
                UserIds = request.UserIds,
                AccessToken = accessToken
            };

            if (!string.IsNullOrEmpty(request.Id))
            {
                syncAccount.Id = request.Id;
            }

            _configurationRetriever.AddSyncAccount(syncAccount);
        }