I am working on a Data Access Layer Design, we have not finalized what ORM we are going to use as of yet. I am leaning towards NHibernate + FluentMappings + Nhibernate.Linq but depending on project timelines we could even wait for EF4. I want to replace methods like :
IList<Customer> FindById(int id);
IList<Customer> FindByName(string fullName);
to
IList<Customer> FindByCriteria(Func<Customer, bool> criteria);
or even
IList<T> FindByCriteria(Func<T, bool> criteria)
so the idea is to chain or build a criteria based on the requirement (from UI or Business ) dynamically to a repository or DAO object. Any code samples, links , blog posts , hints are welcome.
Thanks in advance!