Mad about .NET A blog from Jose Fco Bonnin


23rd, October I did a session about LINQ for the .NET User Group  Madriddotnet.

Re Descubriendo A Linq
View SlideShare presentation or Upload your own. (tags: linq)

During the event we tried to know more in deep how LINQ works, from C-Omega to LINQ to SQL, doing an attempt to solve many of the questions that normally arise when you want to obtain the most of LINQ.

We found Visual Studio 2008 comes with a nice bunch of samples to helps us including visualizers like the Expression Tree Visualizer, which allows you to see the expression tree created from our queries and the LINQ Query Visualizer to see the translation done to Transact/SQL. We knew that it is possible to create queries on the fly using the Dynamic Query Library

We also talked about the benefits of the expression trees and the visitor pattern. You have some sample implementations like the one done by Matt Warren

In the last part of the event we focused on tips for LINQ to SQL to move to a multi-tier architecture. We explained how easy is to serialize LINQ entities to be used over WCF on both directions, this is from Master to Detail and from Detail to Master. How to workaround the fact that circular references are not supported by default by the DataContractSerializer. We gave some ideas about how to do local change tracking of entities when we are disconnected from the DataContext, providing some examples of complete implementations like the one done at MSDN Video (Spanish).

As you can see we talked about many different things and we verified how LINQ can help us during our day to day work making our life much easier if we apply some good practices.

If you attended to the event I hope you enjoyed as much as I did.





ProLinq

I must confess that when I read the title of the book “Pro LINQ Object Relational Mapping with C# 2008” I had big pretensions about the book. ORM, as the author mentions in the introduction, is not a subject commonly treated for the .NET world and I was expecting a deep technical book. This has definitively conditioned my final opinion about it.

The book is divided in several parts. You can see below the main ones.

· First one provides you with a fast overview about the ORM concepts. It explains the problematic between database and conceptual models, problems addressed with ORM, laziness, persistence ignorance, etc.

· Second one presents LINQ to SQL and EF explaining the features each one provides.

· Third part does a “complete” implementation of a sample application which provides you some insights about what it does mean working with LINQ to SQL and EF.

The biggest worth of the book is probably the third part, where the author has not limited to write some excerpts of code, instead he has written some requirements and use cases to later on implement them as a developer would do in the “real world”, including even some unitary tests.

What I didn’t like is that, regardless it presents a wide range of concepts none of them is deeply treated, it always remains on the surface, which in my opinion has made of the book a “sugar free” version of what it could be.

Therefore if you are looking for a deep ORM, LINQ to SQL or EF this is not your book. Instead if you have heard noise about these technologies and you are searching for a text to help you with an overview of what is what and the possibilities they offer, Pro LINQ Object Relational Mapping with C# 2008 can be what you need.