public static T[] Query <T>(this IRepository <T> repository, ISearchCriteria <T> criteria) { return(repository.Query(a => criteria.Apply(a))); }