28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
namespace DeepDrftModels.DTOs;
|
|
|
|
/// <summary>
|
|
/// Cross-project track filter contract. Threaded alongside (never inside) the external
|
|
/// <c>PagingParameters<T></c>, which cannot carry a where-clause. An instance with all
|
|
/// properties null is equivalent to no filter — see <c>TrackFilter.IsEmpty</c>.
|
|
/// </summary>
|
|
public class TrackFilter
|
|
{
|
|
/// <summary>Free-text, case-insensitive LIKE across TrackName, Artist, and Album.</summary>
|
|
public string? SearchText { get; set; }
|
|
|
|
/// <summary>Exact album match.</summary>
|
|
public string? Album { get; set; }
|
|
|
|
/// <summary>Exact genre match.</summary>
|
|
public string? Genre { get; set; }
|
|
|
|
/// <summary>
|
|
/// True when no predicate is set. An empty filter must produce identical results to a null
|
|
/// filter, so callers collapse it to null before querying.
|
|
/// </summary>
|
|
public bool IsEmpty =>
|
|
string.IsNullOrWhiteSpace(SearchText)
|
|
&& string.IsNullOrWhiteSpace(Album)
|
|
&& string.IsNullOrWhiteSpace(Genre);
|
|
}
|