Changing my ORM project to use a fluent interface

One thing I didn’t like about the ORM I’m writing is that you needed to do some non-obvious setup before executing some calls.

Here’s how to setup a call to retrieve all customers whose names contained a string value, and were created before DateTime.Now (that DateTime.Now condition was just to show how to have a second condition).

You needed to create a ConditionList object, populate it with the conditions, and then pass it to the ORM.  Not exactly obvious.

So, I’ve started working on making it a more fluent interface.

Now you can use the following method to perform the same function.

I also have a Set() method, that works similar to the Where() method, for when you do inserts and updates into the database.

Leave a Reply

Your email address will not be published. Required fields are marked *