Remove some useless intermediary type from Rate Source (#5351)

This commit is contained in:
Nicolas Dorier
2023-09-26 16:37:40 +09:00
committed by GitHub
parent 75396f491b
commit 0a956fdc73
7 changed files with 24 additions and 71 deletions

View File

@@ -125,12 +125,11 @@ namespace BTCPayServer.Controllers
{
var exchanges = _rateFactory.RateProviderFactory
.AvailableRateProviders
.Where(r => !string.IsNullOrWhiteSpace(r.Name))
.OrderBy(s => s.Id, StringComparer.OrdinalIgnoreCase)
.ToList();
exchanges.Insert(0, new AvailableRateProvider(null, "Recommended", ""));
exchanges.Insert(0, new (null, "Recommended", ""));
var chosen = exchanges.FirstOrDefault(f => f.Id == selected) ?? exchanges.First();
return new SelectList(exchanges, nameof(chosen.Id), nameof(chosen.Name), chosen.Id);
return new SelectList(exchanges, nameof(chosen.Id), nameof(chosen.DisplayName), chosen.Id);
}
}
}