tags:

views:

61

answers:

2

I'm beginning to wonder if L2S is suitable for large projects. By a large project I mean a database containing many tables spread across many schemas. We would like our entities contained in namespaces that match our database schema names. We have database parent / child relationships that span across schemas. This means our parent / child entities will span across namespaces. L2S isn't able to handle this. In L2S, I cannot model a relationship that involves a parent in one namespace (.DBML) and a child in another namespace (.DBML); at least not without having to write a fair amount of custom code. But this partially defeats the purpose of using L2S.

So, we could put all our entities in a single namespace, which we don't want to do. Or we could write custom code in partial entity class to overcome the modeling limitation. We don't particularly want to do this either.

How have others dealt with this?

Thanks.

+1  A: 

I'm not experienced enough with L2S to comment, but that does seem a downer. Have you looked at Fluent NHibernate? That would alleviate your problems. You can also linq it :)

Luke Schafer
+1  A: 

It appears as though the future of Linq 2 SQL is uncertain. Microsoft appears to be focussing on Entity Framework. I would be careful investing in Linq 2 SQL at this point. Better go with Entity Framework.

Asaph
Not again. This issue has been rehashed ad-nauseum. StackOverflow uses Linq to SQL. It's not going away any time soon.
Robert Harvey
@Robert Harvey: I am aware that SO uses Linq 2 SQL from listening to the podcasts. That doesn't change the fact that Microsoft has announced a focus on Entity Framework.
Asaph
@Asaph - I wouldn't touch the entity framework TBH. @Rober Harvey - I agree with @Asaph... what SO uses is of no consequence.
Luke Schafer
The death of Linq to SQL is FUD that has been spread by several bloggers. All that does is make people ask questions like this on SO.
Robert Harvey