views:

260

answers:

4

I decided to use LINQ to SQL in my personal project after hearing lots of goods. Is there any thing I need to taken care before start using it (during initial design)?

A: 

EDIT Completely rewritten as earlier post was misleading - apologies.

There has been much rumour that Microsoft will not be taking Linq2Sql any further. Fuelled by an ADO.Net team blog post.

Following that there was much speculation on the blogs and on Stack Overflow about whether or not Microsoft were really discontinuing work on Linq2Sql.

If the technology works for you now and does all you need, then great. It may be that Entity Framework, or some other Data Access Model (nHibernate) will work better for you.

Sam Meldrum
@Sam - do you have a link for this statement from Microsoft? Thanks
Galwegian
Sorry Galwegian, I have rewritten the post to make it more accurate and include links to references. I was mistaken that Microsoft had actually come out and said this. Saw it reported as fact on the blogs and assumed it was true. Memo to self: Check your facts.
Sam Meldrum
+1  A: 

See What’s wrong with Linq to SQL?

Galwegian
A: 

In my opinion the biggest downside of using LINQtoSQL is that if your database schema changes you need to re-generate your classes (and lose your code) unless you use some third-party tool to synch-up your DB model with you db schema.

Have a look at this question for further details.

JohnIdol
And lose your code? This is why partial classes were invented, to NOT lose your code
Eduardo Molteni
A: 

If you're going to write data, you require primary keys (for tracking row identity across in-memory objects). These primary keys should be preferably single column.

Watch out for decimal precision and string length.

Watch out for any varchar(1) columns. these get mapped to a .Net char, which can't hold the empty string.

David B