Skip to content

Issue #59: Updated JSON source where dictionary does not contain currentSection name#60

Closed
chriswill wants to merge 1 commit intoaspnet:masterfrom
chriswill:master
Closed

Issue #59: Updated JSON source where dictionary does not contain currentSection name#60
chriswill wants to merge 1 commit intoaspnet:masterfrom
chriswill:master

Conversation

@chriswill
Copy link
Copy Markdown

This is discussed in #59

@chriswill chriswill changed the title Issue #59: Updated JSON source Issue #59: Updated JSON source where dictionary does not contain currentSection name May 10, 2019
Dictionary<string, string> d = _allSettings[_currentSection];
return d ?? _allSettings[""];
{
if (_allSettings.ContainsKey(_currentSection))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use TryGetValue

{
if (_allSettings.ContainsKey(_currentSection))
{
d = _allSettings[_currentSection];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just return the value (since it was retrieved)?

@StephenMolloy
Copy link
Copy Markdown
Collaborator

This has been fixed by #67.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants