public LanguageProvider(IPersistentStorage storage, Random rand, ILogger logger) { _langCollection = storage.RestoreSingle <LanguageResourceCollection>(Collection, LangKey); _rand = rand; _logger = logger; AssertNotNull(_langCollection); }
private void AssertNotNull(LanguageResourceCollection langCollection) { if (!(langCollection is null)) { return; } _logger.LogError("LanguageResources could not restore the ResourceCollection from the Persistent Storage."); throw new NoNullAllowedException("LanguageResourceCollection is null."); }