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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:56:01+00:00 2026-05-23T09:56:01+00:00

Say you have a schema that looks something like this Foo FooId Bar BarId

  • 0

Say you have a schema that looks something like this

Foo
    FooId

Bar
    BarId
    SomeFooId // Foreign key to Foo.FooId
    AnotherFooId // Foreign key to Foo.FooId

I would like to be able to do something like this:

Bar bar = ...
DoSomethingWith(bar.SomeFoo);
DoSomethingElseWith(bar.AnotherFoo);

However, instead of generating SomeFoo and AnotherFoo properties, the linq-to-sql designer generates Foo and Foo1. It is not obvious which of Foo and Foo1 refers to SomeFoo, and which refers to AnotherFoo. Is there any way to manually specify a name for these properties, so that I can refer to them as SomeFoo and AnotherFoo?

I am using the dbml designer in Visual Studio 2010, and I had the same problem with Visual Studio 2008.

  • 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-23T09:56:01+00:00Added an answer on May 23, 2026 at 9:56 am

    You can edit the names in the Linq to SQL designer. Just click on the field you want to rename, press F4, and change the Name Property.

    Alternatively, you can click on the field you want to rename, and just start typing the new name.


    So you want to modify the names of the “convenience properties” that are generated for the foreign keys.

    EDIT:

    I figured it out. In the LINQ to SQL designer click on the association (the line connecting the two associated tables together), expand the “Parent Property” tree and change the Name Property. This will affect the generated name of the “convenience property”.

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

Sidebar

Related Questions

Say I have an .xml file with a menu that looks like this. <?xml
I have a schema that looks like this: +----------+ | tour | +----------+ |
Say I have a schema that represents a fixed-depth hierarchy like this: CREATE TABLE
Say I have this table schema. ID AccNo Amount Say I have this data
Let's say have something like: SELECT energy_produced, energy_consumed, timestamp1 AS timestamp FROM ( SELECT
Let's say I have a schema where User has many Alerts (many to many).
Say you have the following in a schema: <xsd:complexType name=shape/> <xsd:complexType name=circle> <xsd:complexContent> <xsd:extension
I have a set of tables (say Account, Customer) in a schema (say dbo)
I have two tables, both named as say, Employee in two different schema HR
Lets say have this immutable record type: public class Record { public Record(int x,

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.