Last night I after I posted the LINQ DataContext post I realized that I hadn't ever updated the LINQ Business Object Layer example app for .NET 3.5 RTM. Although I've long updated the code, since I use it here in a few internal applications as a base business object wrapper around LINQ to SQL, I hadn't updated the live examples since DevConnections last year. Ooops. This is what happens when I have too much code floating around online - I forget what's up to date and what isn't...
To recap the download includes a small ASP.NET 3.5 Time Tracking sample application which is built around this wwBusinessObject implementation. The TimeTrakker project includes a separate and reusable business object framework project which includes the business object base, an extended DataContext that also provides raw ADO.NET access so DataContext can act as a mini DAL even outside of LINQ based entity queries. I know this kind of sounds like blasphemy but it's come in handy in a few situations (serialization problems with LINQ Entities - able to pass a DataTable for example, or running queries that are way more complex to code with LINQ that as a raw SQL query) as well as taking LINQ queries and grabbing Command objects from them for manual command execution (which is a pretty cool feature of L2S actually).The DataContextFactory I mentioned yesterday also is part of this library.
No rocket science here, but I've been using this light framework in a couple of internal projects here and it's working out really well for me. There might be some useful ideas for others to check out and play wiht.
You can find out more about what's in the Business Object Wrapper from the original post. Note the post's code is Beta 2 so there are a few changes required, but the code in the download is up to date:
A simple Business Object Wrapper for LINQ to SQL
Simple Business Object Wrapper Source and Sample Application
Hope this is useful to some of you.
Other Posts you might also like