This immediately begs the question of why. Classes are by definition reference types and thus are already nullable. It makes no sense to wrap them in a nullable type.
In your case, you can simply define:
public IQueryable<Listing> FindAll(FilterQuery filterQuery)
and call FindAll(null)
to pass no filter query.
If you're using C#/.NET 4.0, a nice option is:
public IQueryable<Listing> FindAll(FilterQuery filterQuery = null)
which means you don't even have to specify the null. An overload would do the same trick in previous versions.
Edit: Per request, the overload would simply look like:
public IQueryable<Listing> FindAll()
{
return FindAll(null);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…