KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I often see example repository patterns that look like this: public interface IRepository<T> { T GetById(int id); IEnumerable<T> GetAllByName(string name); } But how do you handle cases where you may need to do a complex search? I don't think it would be a good idea to add many methods to the interface that would make it end up looking like: IEnumerable<T> GetAllByFirstName(string name); IEnumerable<T> GetAllByLastName(string name); IEnumerable<T> GetAllByFirstAndLastName(string name); IEnumerable<T> GetAllByAddress(string name); ... ... ...
Tags (comma-separated)
Save Edits
Cancel