private async Task <Repository> CreateRepo() { if (!string.IsNullOrEmpty(_gitHelperData.lastGitProfile.projectKey) && !string.IsNullOrEmpty(_gitHelperData.lastRepositoryData.repositoryName)) { WriteLog("Creating of new remote repository..."); try { Repository newRepo = await _bitbucketClient.CreateProjectRepositoryAsync(_gitHelperData.lastGitProfile.projectKey, _gitHelperData.lastRepositoryData.repositoryName); return(newRepo); //await newRepo; } catch (Exception e) { WriteLog(e.Message); return(null); } /*Stopwatch stopwatch = Stopwatch.StartNew(); * /*while (!newRepo.IsCompleted) * { * if (stopwatch.ElapsedMilliseconds < 10000) * { * await Task.Yield(); * } * else * { * stopwatch.Stop(); * WriteLog("Can`t create repo / waiting time is out"); * break; * } * }#1# * * return newRepo.Result;*/ } else { WriteLog("Can`t create remote repository. Repository name or project key is empty"); return(null); } }