R – What would you choose for your data layer today, Linq or Subsonic

data-layerslinqsubsonic

We are ready to start a brand new project at work, no legacy code. We did use Subsonic in the past and we pretty happy with it. But that was before Linq.

Has anyone had to face this same issue (Linq x Subsonic)?

What was your decision? What were the reasons?

Any insight appreciated.

Best Answer

SubSonic

Pros:

  • Nice and simple
  • Scaffolding

Cons:

  • Method signatures often accept string parms (though you're encouraged to use DAO string constants) which can be abused.

Keep in mind:

  • Requires Website project for no-code, hands-off model generation (needs the BuildProvider).

Linq To SQL

Pros:

  • Syntactic sugar in the IDE
  • MS supported
  • View the SQL to be executed in the IDE
  • Allows different levels of fiddling in the model, from auto-generation to explicit definitions down to object properties.

Cons:

  • Complex. You need to learn new concepts like the DataContext to be effective.

Keep in mind:

Also evaluate the ADO.NET Entity Framework and here.