Skip to content

Commit

Permalink
nopSolutions#4154 Fix caching the state provinces by abbreviation
Browse files Browse the repository at this point in the history
  • Loading branch information
holydk committed Nov 20, 2019
1 parent bacb97e commit d8e2c8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static partial class NopDirectoryDefaults
/// {0} : abbreviation
/// {1} : country ID
/// </remarks>
public static string StateProvincesByAbbreviationCacheKey => "Nop.stateprovince.abbreviationcountryid-{0}";
public static string StateProvincesByAbbreviationCacheKey => "Nop.stateprovince.abbreviationcountryid-{0}-{1}";


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public virtual StateProvince GetStateProvinceByAbbreviation(string abbreviation,
if (string.IsNullOrEmpty(abbreviation))
return null;

var key = string.Format(NopDirectoryDefaults.StateProvincesByAbbreviationCacheKey, abbreviation, countryId.HasValue ? countryId.Value : 0);
var key = string.Format(NopDirectoryDefaults.StateProvincesByAbbreviationCacheKey, abbreviation, countryId ?? 0);
return _cacheManager.Get(key, () =>
{
var query = _stateProvinceRepository.Table.Where(state => state.Abbreviation == abbreviation);
Expand Down

0 comments on commit d8e2c8f

Please sign in to comment.