What's better practice when defining several methods that return the same shape of data with different filters? Explicit method names or overloaded methods? For example. If I have some Products and I'm pulling from a database explicit way: public List<Product> GetProduct(int productId) { // return a List } public List<Product> GetProductByCategory(Category category) { // return a List } public List<Product> GetProductByName(string Name ) { // return a List } overloaded way: public List<Product> GetProducts() { // return a List of all products } public List<Product> GetProducts(Category category) { // return a List by Category } public List<Product> GetProducts(string searchString ) { // return a List by search string } I realize you may get into a problem with similar signatures , but if you're passing objects instead of base types (string, int, char, DateTime, etc) this will be less of an issue. So... i...
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update