in src/Relecloud.Web.CallCenter/Infrastructure/ExtensionMethods.cs [56:94]
public static IHtmlContent LinkForSearchFacet(this IHtmlHelper html, SearchRequest request, SearchFacet facet, SearchFacetValue facetValue)
{
var routeValues = request.Clone();
var linkText = $"{facetValue.DisplayName} ({facetValue.Count})";
if (string.Equals(facet.FieldName, nameof(Concert.Price), StringComparison.OrdinalIgnoreCase))
{
if (!string.IsNullOrWhiteSpace(routeValues.PriceRange))
{
linkText = "[X] " + linkText;
}
else
{
routeValues.PriceRange = facetValue.Value;
}
}
else if (string.Equals(facet.FieldName, nameof(Concert.Genre), StringComparison.OrdinalIgnoreCase))
{
if (!string.IsNullOrWhiteSpace(routeValues.Genre))
{
linkText = "[X] " + linkText;
}
else
{
routeValues.Genre = facetValue.Value;
}
}
else if (string.Equals(facet.FieldName, nameof(Concert.Location), StringComparison.OrdinalIgnoreCase))
{
if (!string.IsNullOrWhiteSpace(routeValues.Location))
{
linkText = "[X] " + linkText;
}
else
{
routeValues.Location = facetValue.Value;
}
}
return html.ActionLink(linkText, "Search", "Concert", null, null, null, routeValues, null);
}