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

The Archive Base Latest Questions

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

I have an table called Invoices with a column named Vendor. The Vendor column

  • 0

I have an table called Invoices with a column named Vendor. The Vendor column is a FK reference to a Vendors table with the PK being Id.

My dbml creates the appropriate objects…Invoice and Vendor. However, my Invoice object has both a Vendor property (as a String) and a Vendor1 property (as a Vendor object).

I thought it would have to do with my column name matching the referenced object name but after changing the column to VendorId and recreating all the dbml objects the repeated property was still there. Looks like it is because of the column matching the object…it creates Vendor to hold the String value and then Vendor1 to reference the Vendor object. Why does it not just create the single object reference?

Thanks

  • 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-13T11:20:17+00:00Added an answer on May 13, 2026 at 11:20 am

    It’s not a repeated property – it’s two different properties for two different purposes.

    The Vendor property corresponds to the data in the column in your database.

    The Vendor1 property represents the foreign key relation, i.e. the join to another table. It’s called Vendor1 because the name Vendor was already taken (using VendorId for the column name is a good idea). The Vendor1 object won’t be fetched by default unless you actually use it. Having this property available makes it easier to formulate queries that would otherwise require you to specify a join.

    Both properties are useful to have on your object.


    To answer your updated question:

    Linq has to fetch the vendor id anyway whether you use it or not – just in case you might use it. Since it has already been fetched it seems convenient that it is also visible in the interface. If you wrote obj.Vendor1.Id instead of obj.VendorId, it would cause the Vendor1 object to be fetched from the database unnecessarily. So there is also a performance implication.

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

Sidebar

Related Questions

I have a table called invoices with 3 fields (for the purposes of this
i have table called as Support, which have a field named Name and contains
I have table called Buttons. Buttons table i have column button_number . Table contain
I have a table called invoices: `si_invoices` ( `id` int(10) , `biller_id` int(10) ,
I have table name called Person with following column names P_Id(int), LastName(varchar), FirstName (varchar).
So I have two objects, Invoice and InvoiceLineItem. InvoiceLineItem has a property called cost
So, The situation is like this: I have one table called invoice, and it
I have a table called invoices. to help make this question simple we will
I have table called stats . In am inserting yes or no in the
I have table called posts in my DB. Each post has field called social_network

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.