I’m still sitting in the session but before I forget some of the stuff I decided to start blogging anyway, while still trying to concentrate
Linq to Sql (formerly known as DLINQ) is an extremely powerfull ORM (object relational mapper). It goes way beyond the products available at the moment. I’ve had some experience in using ORM (both static generators and dynamic frameworks) but Dlinq just goes that little bit further.
Thanks to the query language itself which is mapped to very good SQL, it doesn’t have the performance problems that some of the ORM frameworks have. Anders Hejlsberg is showing us a number of complex linq queries that are mapped to their equivalent complex T-Sql queries.
I should also note that DLinq uses a mapping between class and DB, so it doesn’t generate it on the fly, but there are three way to create a mapping. Create the class manually and attach attributes, use an xml mapping file or use the SQLMetal command line utility that will generate the csharp files and mappings manually. It will generate objects for tables, views (which are mapped to tables), sprocs and functions. Stored Procedures are converted into methods with full Intelli-Sense support and functions aswell. You can (if you specify it manually) also tell the mapper to use sprocs for insert, delete and updates of objects.
Under the hoods it’s using optimistic concurrency and will throw an Exception with options for resolving the problem.
If DLinq is not sufficient enough, because you need to write some more or less complex custom sql code, you can do so and still utilize the Linq infrastructure (identity mapping…) and it will map back to classes.
It’s probably a bit of a learning effort getting to know Linq and all the language constructs, but once you know it, you can rely on the way the sql is generated and concentrate on what you should be doing, the business logic.
Download and more Info on Linq
Tags: TechEd-Developers