@using WebfrontCore.ViewModels @using System.Globalization @using SharedLibraryCore.Database.Models @model WebfrontCore.ViewModels.ScoreboardInfo @{ Layout = null; object OrderByFunc(ClientScoreboardInfo item) { var property = typeof(ClientScoreboardInfo).GetProperties().FirstOrDefault(prop => prop.CanRead && prop.Name.Equals(Model.OrderByKey, StringComparison.InvariantCultureIgnoreCase)); return property != null ? property.GetValue(item) : item.Score; } string GetColumnSortDisplay(string propertyName) { if (propertyName == (Model.OrderByKey ?? nameof(ClientScoreboardInfo.Score))) { return Model.ShouldOrderDescending ? "▼" : "▲"; } return null; } string GetTeamBackgroundColorClass(ClientScoreboardInfo client) { return $"team-{client.Team.ToString().ToLower()}-bg {(client.Team == EFClient.TeamType.Unknown ? "bg-dark-dm bg-light-lm" : "")}"; } }