Extending System.Data.Linq.Table<T> – Exportable Linq2SQL Classes
by Andrew Freemantle • December 3, 2012 • 0 Comments
Wouldn’t this be handy?:
|
1 2 3 |
using (var db = new DataContext()) { return db.StockItems.ToXElement(); } |
I’ve found this approach useful when working on API’s which essentially provide access to data that closely mirrors Linq2SQL generated classes. It makes it easy to control which properties are included, and how they are formatted. First, we declare an interface that we can decorate our Linq2SQL classes with. Note [...]
Read more →