Skip to content
Permalink
Browse files

Specify to use Opserver's ToHashSet for spaceIds to prevent an ambigu…

…ous method error with Enumerable.ToHashSet. (#343)

Viewing the storage modal on a database has an ambiguous error with ToHashSet.
  • Loading branch information...
TommyRush authored and NickCraver committed Jul 9, 2019
1 parent 2aa97ed commit caa087c71dcefe948981ced6d4d34bdc18bc2339
Showing with 1 addition and 1 deletion.
  1. +1 −1 Opserver/Views/SQL/Databases.Modal.Storage.cshtml
@@ -9,7 +9,7 @@
var files = filesRaw?.Data?.Where(f => f.DatabaseId == db?.Id).OrderBy(f => f.FileType).ThenBy(f => f.PhysicalName);
var tablesRaw = i?.GetTableInfo(Model.Database);
var tables = tablesRaw.Data?.OrderByDescending(t => t.TotalSpaceKB).ThenBy(t => t.TableName).ToList();
var spaceIds = files?.Select(f => f.DataSpaceId).Where(id => id > 0).ToHashSet() ?? new HashSet<int>();
var spaceIds = StackExchange.Opserver.ExtensionMethods.ToHashSet(files?.Select(f => f.DataSpaceId).Where(id => id > 0)) ?? new HashSet<int>();
var spacesRaw = i?.GetDataSpaceInfo(Model.Database);
var spaces = spacesRaw.Data?.Where(ds => spaceIds.Contains(ds.Id)) ?? new List<SQLInstance.DatabaseDataSpace>();
const int topTableShowCount = 10;

0 comments on commit caa087c

Please sign in to comment.
You can’t perform that action at this time.