Separating data from the UI code with Linq to SQL entities

Posted by Sir Psycho on Stack Overflow See other posts from Stack Overflow or by Sir Psycho
Published on 2010-06-14T08:39:35Z Indexed on 2010/06/14 8:42 UTC
Read the original article Hit count: 169

If it's important to keep data access 'away' from business and presentation layers, what alternatives or approaches can I take so that my LINQ to SQL entities can stay in the data access layer?

So far I seem to be simply duplicating the classes produced by sqlmetal, and passing those object around instead simply to keep the two layers appart.

For example, I have a table in my DB called Books. If a user is creating a new book via the UI, the Book class generated by sqlmetal seems like a perfect fit although I'm tightly coupling my design by doing so.

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about design-patterns