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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:59:47+00:00 2026-06-08T15:59:47+00:00

I have two tables with the following definitions: CREATE TABLE [dbo].[Shows] ( [Id] UNIQUEIDENTIFIER

  • 0

I have two tables with the following definitions:

    CREATE TABLE [dbo].[Shows] (
    [Id]              UNIQUEIDENTIFIER NOT NULL,
    [Name]            NVARCHAR (1024)  NOT NULL,
    [Image]           NVARCHAR (1024)  NULL,
    [Description]     NTEXT            NULL,
    [Seasons]         INT              NOT NULL,
    [FacebookId]      BIGINT           NULL,
    [BackgroundImage] NVARCHAR (200)   NULL,
    [TheTvDbId]       BIGINT           NULL,
    [NetworkId]       UNIQUEIDENTIFIER NOT NULL,
    CONSTRAINT [PK_Shows] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_Shows_ToNetworks] FOREIGN KEY ([NetworkId]) REFERENCES [dbo].[Networks] ([Id])
);

        CREATE TABLE [dbo].[TheTvDb]
    (
        [Id] UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL, 
        [EntityId] UNIQUEIDENTIFIER NOT NULL, 
        [TheTvDbId] BIGINT NOT NULL,
        [LastUpdated] BIGINT NOT NULL DEFAULT 0, 
        CONSTRAINT [AK_TheTvDb_EntityId] UNIQUE ([EntityId]),
        CONSTRAINT [AK_TheTvDb_TheTvDbId] UNIQUE ([TheTvDbId])
    )

What I want to do is to create an association property TheTvDbLastUpdated on the Shows table that points to the property LastUpdated of table TheTvDb. The key linking TheTvDb record with Shows record is EntityId. The relationship is one to one. I know how to create association that will link to the whole TheTvDbTable but I do not know how to link only to this one property, which would make it more convenient to access it from the generated entity classes. Thanks.

I use database-first approach, so I’m looking for a way to do it from the designer of the .edmx 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-06-08T15:59:50+00:00Added an answer on June 8, 2026 at 3:59 pm

    That’s not possible. Properties that “point” to something are references/navigation properties. You can’t make a scalar/value type a navigation property.

    A convenient helper might be a readonly helper property (implemented in partial class file, not EDMX):

    public partial class Show
    {
        public long TheTvDbLastUpdated { get { return this.TheTvDb.LastUpdated; } }
    }
    

    Where TheTvDb would be the one-to-one navigation property from Show to TheTvDb. If you use lazy loading accessing this property would load the TheTvDb entity from the database first if it hasn’t been already loaded yet. If you don’t use lazy loading TheTvDb can be null and accessing the property would cause an exception. You might catch this case:

    public long TheTvDbLastUpdated
    {
        get
        {
            if (this.TheTvDb == null)
                throw new InvalidOperationException(
                    "TheTvDbLastUpdated cannot be accessed before TheTvDb is loaded.");
            return this.TheTvDb.LastUpdated;
        }
    }
    

    Anyway, you need the navigation property for this, and it doesn’t look like a big win if you write show.TheTvDbLastUpdated instead of show.TheTvDb.LastUpdated (actually the win is just saving one single dot).

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

Sidebar

Related Questions

I have two tables with the following schema: CREATE TABLE sales_data ( sales_time date
I have two tables that look like following: RELEASE TABLE name asin MATCHES TABLE
I have the following table definition: CREATE TABLE [Car] ( CarID int NOT NULL
I have two tables with the following (simplified) structures: table "Factors" which holds data
Say I have two tables, user and comment . They have table definitions that
I have two tables and the following query: table1 --------- table1Id(pk) fromdate, todate, name,
I have two tables as following table one named tbooking having column fields as
I have two tables: candidate_register_table with the following schema: |----------------------------------------------------| | username | name
I have two tables in my database as following: Suggestions Table: ID, Title, Description,
I have two tables with the following information : Products Name | ID |

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.