I perform some naive searches in my application, and the search will be performed on several different types of objects (Customer, Appointment, Activity, etc.). I am trying to create an interface that will have types that are searchable. I would like to do something like this:
public interface ISearchable
{
string SearchDisplay { get; }
static IEnumerable<ISearchable> Search(string searchFor);
}
I already have a concrete implementation of this on one of the objects of my domain model, but I would like to extend it to others.
The problem is obvious: you cannot have static methods on the interface. Is there another prescribed method for doing what I'm looking for, or is there a workaround?
source
share