I'm stumped with NHibernate and my Domain Model right now. I'm imagining a nice API in my head but I'm having a really hard time making it a reality. Here's an example of what I'm trying to accomplish:
Trip trip = new Trip("Austria2009");
foreach(User user in trip.People.Crew.IsApproved())
{
reponse.write(user.Firstname);
}
// Or I could hack some of the stuff off above and make it look like this
foreach(User user in trip.People.Crew)
{
reponse.write(user.Firstname);
}
// Or yet again pull all the people back and forget a specific role
foreach(User user in trip.People)
{
reponse.write(user.Firstname);
}
So does that stuff in the Foreach loop making any lick of sense? :P I feel like I'm trying to create some kind of fluent interface with my classes. I'm using NHibernate for persistence so is something like this possible or do I just need to make things a LOT simpler?