Great Query DSL

Update: Ayenda replied with the following

This is Rhino Commons repository + NHibernate Query Generator code.

Ayende posted an example of a great query DSL. Is this real? If so, where can I download this framework?

ICollection<Event> eventsInTwoDays = Repository<Event>.FindAll(        Where.Event.ScheduledDate == DateTime.Today.AddDays(2) &&        Where.Event.Participants.With(FetchMode.Join)    );

2 Responses

  1. Rhino Commons and NHibernate Query Generator are two of Ayende’s projects. They available via public svn, or zip download on his website. Running the NHQG generates a set of classes which provides a DSL which effectively generates a DetachedCriteria for NH. Repository is a static class which resolves an implementation of IRepository from an IoC container. There are several implementations of IRepository provided for you to use, or you can of course provide your own.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: