I am working on a library that will contain many filter methods.
I have seen many project that use this syntax for filters
public Foo GetFooByBar(bar);
In other project people use this syntax
public Foo GetFooWithBar(bar);
Since this library will be reused by many other developers I wanted to know which one developers feel more comfortable with.
Please let me know which you prefer and if possible why.
Thanks
EDIT: The first few answers suggest just overloading a GetFoo method to accept various arguments. This works well for a standard interface in a language that supports overloading. But in my case some I will also have some more fluent apis so I will want to link various filters like this
Foo GetFoo().ByBar(bar).ByBaz(Baz); or Foo GetFoo().WithBar(bar).WithBaz(baz);