public async Task <IActionResult> OnGetAsync(string assetId) { try { if (_env.DB_TABLE.IsNotBlank()) { this.Asset = await _db.GetAsset(assetId); } else { var assets = await JsonLoader.LoadAssets(_hostingEnv.ContentRootPath); this.Asset = assets.Single(a => a.Id == assetId); } } catch (NullReferenceException) { return(NotFound()); } return(Page()); }