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 711023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:41:18+00:00 2026-05-14T04:41:18+00:00

I have a .dbml file which of course contains the auto-generated classes based on

  • 0

I have a .dbml file which of course contains the auto-generated classes based on my tables.

I would however, like to extend them to my own classes. Typically I design such that each of my tables get their own namespace in their own folder containing all of their associated dao and service classes. So if I am dealing with a page that only has to do with ‘customers’ for instance, I can only include the customerNS.

But when using LINQ I seem to be unable to do this. I have tried removing a default namespace from the project, I have tried putting the .dbml file into it’s own folder with a custom namespace and then adding a ‘using’ statement, but no nothing works.

I also saw the Entity Namespace, Context Namespace, and Custom Tool Namespace properties associated with the .dbml file and tried setting all these to names x and trying ‘using x’ in my other class to allow me to extend partial classes, but it just doesn’t work.

Is this possible or do I have to keep all extended partial classes in the same namespace as the .dbml file?

  • 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-14T04:41:18+00:00Added an answer on May 14, 2026 at 4:41 am

    If the types don’t have relations the answer is simple: use multiple dmbl files. If you need relations and you also want multiple namespaces read on.

    You might be able to get this done with a T4 template file. In VS2010 there’s a template to create one (it’s called a generator template or something). For VS2008 you can find one on codeplex

    The changes you’ll need to make to the standard template is you need to make sure that all properties use fully qualified names (because the related types are now in different namespaces). And for most control you can probably skip the namespace info from the generated classes (so you can define it in your partial classes).

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

Sidebar

Related Questions

I have a dbml to which I have added more then 15 tables from
I have a class reflecting my dbml file which extends DataContext, but for some
I have two tables in a LINQ to SQL dbml file. I am trying
I have a database, I create a dbml file and drop the tables it.
I have the following 3 classes in my dbml file: public class Player {
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
I have a rather large DBML file and recently discovered that Visual Studio's MSLinqToSQLGenerator
I'm playing with LINQ-To-SQL in .NET 3.5 and have built some classes based on
I have added a table(ViolationsDataSourceConfig) to the dbml file. The context name is ViolationsDataContext.

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.