Prefer namespace lookups first

This commit is contained in:
Dean Herbert 2018-07-10 15:23:47 +09:00 committed by GitHub
parent ba258b8a05
commit 14c3cc70b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -46,16 +46,17 @@ public virtual IEnumerable<string> LookupNames
{
get
{
if (!string.IsNullOrEmpty(Suffix))
if (!string.IsNullOrEmpty(Namespace))
{
if (!string.IsNullOrEmpty(Namespace))
if (!string.IsNullOrEmpty(Suffix))
yield return $"{Namespace}/{Bank}-{Name}{Suffix}";
yield return $"{Bank}-{Name}{Suffix}"; // Without namespace as a fallback even when we have a namespace
yield return $"{Namespace}/{Bank}-{Name}";
}
if (!string.IsNullOrEmpty(Namespace))
yield return $"{Namespace}/{Bank}-{Name}";
yield return $"{Bank}-{Name}"; // Without namespace as a fallback even when we have a namespace
// check non-namespace as a fallback even when we have a namespace
if (!string.IsNullOrEmpty(Suffix))
yield return $"{Bank}-{Name}{Suffix}";
yield return $"{Bank}-{Name}";
}
}