Q:

Association of a single property from different table in EF 4.3

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.

A:

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).

