using InABox.Core; using System; using System.Collections.Generic; using System.Text; namespace Comal.Classes { public class ProductInstanceLookups : EntityLookup { #region Default Lookups (should always be empty) public override Filter? DefineFilter() { return new Filter().None(); } public override SortOrder DefineSortOrder() { return new SortOrder(x => x.Sequence); } #endregion public override string FormatLookup(Dictionary values, IEnumerable exclude) { List result = new List(); if (values.TryGetValue("Dimensions.UnitSize", out object size) && !String.IsNullOrWhiteSpace(size?.ToString())) result.Add(size); if (values.TryGetValue("Style.Description", out object description) && !String.IsNullOrWhiteSpace(description?.ToString())) result.Add(description); return String.Join(" ", result); } } }