Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 653113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:20:46+00:00 2026-05-13T22:20:46+00:00

I see a number of posts talk about rolling your own LINQ to SQL

  • 0

I see a number of posts talk about rolling your own LINQ to SQL XML mapping file. Why would you do this instead of using SQLMetal or the designer built into studio? Is it because you want to work with your own POCOs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:20:47+00:00Added an answer on May 13, 2026 at 10:20 pm

    If you use the designer then you have no control over the generated classes. While this may be alright for many applications, it’s not appropriate for all.

    Probably the biggest single advantage to using an external mapping is that it breaks your model’s dependency on Linq to SQL, so you could (for example) take the exact same model classes and use them with Entity Framework or NHibernate. Projects or assemblies which need to use the model don’t pick up an unwanted dependency on the System.Data.Linq assembly.

    Other things you might want to do are:

    • Include validation logic or other complex logic in property setters;
    • Use virtual properties (for proxying);
    • Decorate existing properties with other attributes (i.e. serialization);
    • etc.

    None of these things are possible with generated code. You can extend via partial classes, but that only lets you add members, not change existing ones. You can change the designer-generated code, obviously, but your changes will just get overwritten.

    As I mentioned, many projects don’t need these things, but many projects do, and if yours is one that does then you’ll outgrow the DBML designer and SqlMetal pretty quickly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see a number of other people asking about this error message in other
I've read a number of posts about this error, but none of the solutions
I see a number of posts on this, but I'm still struggling. I've got
I'd like the community's take on some thoughts I've had about Linq to Sql
Have seen multiple posts on this but I can't see any which answer my
I've seen a number of posts about using salts and hashes to create secure
I read a few posts here about the magic number 0xCAFEBABE in the beginning
I see bundle version in xcode. Do I increment this number & compile and
I see a number of posts on the various problems folks have with troubleshooting
I can see a number of other good answers to questions relating to CSS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.