Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. Entity Framework should be simple, right? [modified]

Entity Framework should be simple, right? [modified]

Scheduled Pinned Locked Moved LINQ
questioncomhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OrsaPoison
    wrote on last edited by
    #1

    I have 2 tables create table Countries ( ID bigint not null, FullName nvarchar(255) not null unique, constraint PK_Countries_ID primary key (ID) ) go create table CountryStates ( ID bigint not null identity(1,1), FullName nvarchar(255) not null, ShortName nvarchar(10) null, CountryID bigint not null, constraint PK_CountryStates_ID primary key (ID), constraint FK_CountryStates_CountryID foreign key (CountryID) references Countries(ID) ) go I need to create an Entity that has the following properties ID (mapped to CountryStates.ID) Fullname (mapped to CountryStates.FullName) Shortname (mapped to CountryStates.ShortName) CountryID (mapped to CountryStates.CountryID or COuntries.ID Whatever for the start) CountryFullName (mapped to Countries.FullName) link to studio screen http://www.avwork.com/misc/MappingScreen.jpg The error message is on the screen. I expect the inner join to happen when selecting CountryStates. Why does it not compile?

    modified on Thursday, July 9, 2009 1:02 PM

    D 1 Reply Last reply
    0
    • O OrsaPoison

      I have 2 tables create table Countries ( ID bigint not null, FullName nvarchar(255) not null unique, constraint PK_Countries_ID primary key (ID) ) go create table CountryStates ( ID bigint not null identity(1,1), FullName nvarchar(255) not null, ShortName nvarchar(10) null, CountryID bigint not null, constraint PK_CountryStates_ID primary key (ID), constraint FK_CountryStates_CountryID foreign key (CountryID) references Countries(ID) ) go I need to create an Entity that has the following properties ID (mapped to CountryStates.ID) Fullname (mapped to CountryStates.FullName) Shortname (mapped to CountryStates.ShortName) CountryID (mapped to CountryStates.CountryID or COuntries.ID Whatever for the start) CountryFullName (mapped to Countries.FullName) link to studio screen http://www.avwork.com/misc/MappingScreen.jpg The error message is on the screen. I expect the inner join to happen when selecting CountryStates. Why does it not compile?

      modified on Thursday, July 9, 2009 1:02 PM

      D Offline
      D Offline
      DoctorMick
      wrote on last edited by
      #2

      Your link to the screen image doesn't work.

      O 1 Reply Last reply
      0
      • D DoctorMick

        Your link to the screen image doesn't work.

        O Offline
        O Offline
        OrsaPoison
        wrote on last edited by
        #3

        Edited. Thank you Should work how

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups