Hi
I'm creating a C# application using ActiveRecord as my datalayer. I've created a business class named UserGrabber which is supposed to find users by using it's properties to send as filters into a ActiveRecord.Find Method.
For example a User class. The client needs to find all users that have active directory name starting with "anna" and with SSN containing 4229. Then I would like to do
UserGrabber grabber = new UserGrabber();
grabber.ADName = "anna";
grabber.SSN = "4229";
grabber.Grab();
foreach(User user in grabber.Users)
{
Console.WriteLine(user.FullName);
}
The trick is that I don't have to send information to UserGrabber unless I want to filter by it, I could have send just in grabber.ADName, then the SSN would not be filtered by.
The problem is I can't seem to grasp how to do this in ActiveRecord. Maybe I could use the ExecuteQuery(Castle.ActiveRecord.IActiveRecordQuery) or FindAll(NHibernate.Criterion.ICriterion) ?