public static IQueryable <ArtistName> FilterByArtistName(this IQueryable <ArtistName> query, ArtistSearchTextQuery textQuery) { var canonizedName = textQuery.Query; if (textQuery.IsExact) { return(query.Where(m => m.Value == canonizedName || m.Value == string.Format("{0}P", canonizedName) || m.Value == string.Format("{0}-P", canonizedName))); } else { return(FindHelpers.AddEntryNameFilter(query, textQuery)); } }
public static IQueryable <ArtistName> FilterByArtistName(this IQueryable <ArtistName> query, string originalQuery, string canonizedName = null, NameMatchMode matchMode = NameMatchMode.Auto, string[] words = null) { canonizedName = canonizedName ?? ArtistHelper.GetCanonizedName(originalQuery); if (FindHelpers.ExactMatch(canonizedName, matchMode)) { return(query.Where(m => m.Value == canonizedName || m.Value == string.Format("{0}P", canonizedName) || m.Value == string.Format("{0}-P", canonizedName))); } else { return(FindHelpers.AddEntryNameFilter(query, canonizedName, matchMode, words)); } }
public static IQueryable <T> AddEntryNameFilter <T>(this IQueryable <T> query, string nameFilter, NameMatchMode matchMode, string[] words = null) where T : LocalizedString { return(FindHelpers.AddEntryNameFilter(query, nameFilter, matchMode, words)); }
public static IQueryable <T> AddEntryNameFilter <T>(this IQueryable <T> query, SearchTextQuery textQuery) where T : LocalizedString { return(FindHelpers.AddEntryNameFilter(query, textQuery)); }