Skip to content

Commit

Permalink
closes #3601
Browse files Browse the repository at this point in the history
  • Loading branch information
ebicoglu committed Apr 14, 2020
1 parent 8398455 commit ff5c55d
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,22 @@ public async Task<ProjectBuildResult> BuildAsync(ProjectBuildArgs args)
args.TemplateSource
);

DeveloperApiKeyResult apiKeyResult;
DeveloperApiKeyResult apiKeyResult = null;

#if DEBUG
apiKeyResult = _configuration.GetSection("apiKeyResult").Get<DeveloperApiKeyResult>(); //you can use user secrets
try
{
var apiKeyResultSection = _configuration.GetSection("apiKeyResult");
if (apiKeyResultSection.Exists())
{
apiKeyResult = apiKeyResultSection.Get<DeveloperApiKeyResult>(); //you can use user secrets
}
}
catch (Exception e)
{
Console.WriteLine(e);
}

if (apiKeyResult == null)
{
apiKeyResult = await ApiKeyService.GetApiKeyOrNullAsync();
Expand Down

0 comments on commit ff5c55d

Please sign in to comment.