I'm a music and software developer who's probably off looking for a cup of coffee right now.
Wouldn’t it be loverly if we could just ask a steaming pile of SalesOrderHeaders for these things, one at a time, in plain English? Picture it.Seriously, see it first—great APIs start by envisioning the consuming code up front:
var myOrders = db.SalesOrderHeadersWhat’s killer about what we’re about to pull off here is that we can make this happen without ever sullying our data access code. We can keep the logic in a totally separate layer. This is made possible by the modern .NET miracle of Extension Methods, a feature introduced in .NET 3.0, largely to make LINQ possible at all. And in the same way NASA indirectly gave us a really pretty nice pen because Neil and Buzz and pals needed to scratch chickens whilst being floaty and disoriented, the benefits of the necessity extend beyond the mother of their invention. See what I did there? Extend. Moving on.
.From(DateTime.Today.AddDays(-7))
.To(DateTime.Today)
.FromOnline()
.ThatAreHighlyTaxed()
.ThatWereMadeOnA(DayOfWeek.Thursday)
.OrderedByARelative();
Get Your “Legos” Right With Fluent Query Extensions [ Aptera Software ]
Designed by Simon Fletcher, hacked a bit by Jon. Powered by Tumblr.
© Copyright 2010