0

Im working on an ASP.NET app and using LINQ to SQL for the first time and something seems off. Usually on a web project, there is a data access layer, a biz layer and the preso layer....does linq to sql not work this way? I see where other developers have put the DataContext directly into the Preso layer and are calling the DB via linq from there. Is that the correct way to do it? no biz layer? Thanks John

3 Answers 3

1

If you are looking for more layers of abstraction between you and the database, perhaps LinqToSql is no the right choice for you. Perhaps the ADO.NET Entity Framework is a better choice.

Sign up to request clarification or add additional context in comments.

Comments

0

You can encapsulate LINQ in a data access layer. But for most small to mid size projects, it's good enough.

You should always have the high level goals in mind. You use object orientation and design patterns to lower the cost of implementation and maintainability. There is no need to overengineer when the simplest and fastest design satisfies most of the needs and is maintainable enough.

Comments

0

An usual practice is also to implement the Repository pattern:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.