Getting the Entity does not have a key defined but it actually does.

So I am trying to use EF 6 with the AdventureWorks database to build out some web api services.
Everything was going well until I added the EmployeeDepartmentHistory table and then I keep getting the  "The entity "EmployeeDepartmentHistory' does not have a key defined."
But here is my edmx file which does have it defined.
edmx:
<EntityType Name="EmployeeDepartmentHistory">
<Key>
<PropertyRef Name="BusinessEntityID" />
<PropertyRef Name="DepartmentID" />
<PropertyRef Name="ShiftID" />
<PropertyRef Name="StartDate" />
</Key>
<Property Name="BusinessEntityID" Type="int" Nullable="false" />
<Property Name="DepartmentID" Type="smallint" Nullable="false" />
<Property Name="ShiftID" Type="tinyint" Nullable="false" />
<Property Name="StartDate" Type="date" Nullable="false" />
<Property Name="EndDate" Type="date" />
<Property Name="ModifiedDate" Type="datetime" Nullable="false" />
</EntityType>
<EntityType Name="EmployeeDepartmentHistory" Abstract="false">
<Key>
<PropertyRef Name="BusinessEntityID" />
<PropertyRef Name="DepartmentID" />
<PropertyRef Name="ShiftID" />
<PropertyRef Name="StartDate" />
</Key>
<Property Name="BusinessEntityID" Type="Int32" Nullable="false"/>
<Property Name="DepartmentID" Type="Int16" Nullable="false" />
<Property Name="ShiftID" Type="Byte" Nullable="false" />
<Property Name="StartDate" Type="DateTime" Nullable="false" Precision="0" />
<Property Name="EndDate" Type="DateTime" Precision="0" />
<Property Name="ModifiedDate" Type="DateTime" Nullable="false" Precision="3" />
<NavigationProperty Name="Department" Relationship="AdventureWorks2012Model.FK_EmployeeDepartmentHistory_Department_DepartmentID" FromRole="EmployeeDepartmentHistory" ToRole="Department" />
<NavigationProperty Name="Employee" Relationship="AdventureWorks2012Model.FK_EmployeeDepartmentHistory_Employee_BusinessEntityID" FromRole="EmployeeDepartmentHistory" ToRole="Employee" />
<NavigationProperty Name="Shift" Relationship="AdventureWorks2012Model.FK_EmployeeDepartmentHistory_Shift_ShiftID" FromRole="EmployeeDepartmentHistory" ToRole="Shift" />
</EntityType>
Please help I've been stuck on this for days. I've tried deleting it and re-adding it but to no avail.

EmployeeDepartmentHistory and this table itself has a primary key on it?

Similar Messages

  • OBIEE 11g: Fact table does not have  a properly defined primary key

    Hi,
    We have two fact tables and two dimension tables.
    We have joined the tables like
    D1-->F1
    D2-->F2
    D1-->D2
    We dont have any hieracies.
    It is throwing error in consistency check,
    [nQSError: 15001] Could not load navigation space for subject area ABC.
    [nQSError: 15033] Logical table Fact1 does not have a properly defined primary key.
    It is not like STAR Schema, its like snowflake schema. How to define primary key for fact table.
    Thanks.

    Hi,
    My suggestion would be bring both the facts to the same logical table sources and have a single fact table in the BMM layer joined with multiple dimensions.
    Build a dimension hierarchy for the dimensions and then in the content logical layer mapping, map the dimensions to the fact tables with detailed level/Total
    Refer the below link-
    http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
    Hope this help's
    Thanks,
    Satya

  • External video projector - How can I hook up my Mini DisplayPort to DVI Adapter onto my new MacBookAir if the machine does not have a mini port (but only 2 USBs and 1 Thunderbolt)?

    Hi
    How can I hook up my DVI Adapter onto my new MacBookAir if the machine does not have a mini port (but only 2 USBs and 1 Thunderbolt)?
    Is there a DVI adaptor already for Thunderbolt?
    Thanks,
    JFR

    The Mini Display port and Thunderbolt port use compatible connector bodies. Your current Mini Display to DVI or VGA adapter will still work as before on the newer Thunderbolt capable machines.

  • How to resolve Nqserror:15033 : FACT_TABLE does not have a properly defined

    Hello All,
    I have a model wherein when i modify a join(b/w a fact and a dim1 is modified to fact and dim2), i get the following error..
    [nQSError: 15001] Could not load navigation space for subject area SA.
    [nQSError: 15033] Logical table Fact_Marketing does not have a properly defined primary key.
    Why am i getting an error to have a primary key on a fact table..!
    Yet if i define a key, no errors come up. But, it throws error in the presentation services.
    and one more important one is..
    the error it is throwing on a table "Fact_Marketing" is not at all included in the modifications mentioned above..
    only thing i have in common is,
    both the dimensions dim1, dim2 are joined directly to both the facts..
    Any pointers into this issue would definitely help me..
    Thanks in advance.

    Sounds like it's not recognising that your table is a fact table. Is the icon showing as the fact table icon rather than the dimension icon against it?
    If not then is your logical join the correct way around? (many end towards the fact table)
    If you're on 10g then also make sure you're using a complex join, not a foreign key join in the business model.

  • How can I connect my 3gen apple tv with HDMI to my bush LCD32TV022HD which does not have an HDMI port but does have 1)S-Video I/P, 2)Video I/P, 3) L

    How can I connect my 3gen apple tv with HDMI to my BUSH LCD32TV022HD
    This does not have an HDMI port but does have:-
    1) S-Video I/P,
    2) Video I/P,
    3) Audio Input (Left & Right)
    4) Audio In jack (for VGA and DVI source)
    5) DVI input
    6) VGA input

    Welcome to the Apple community.
    The Apple TV doesn't officially support a DVI connection, however you may be able to get it to work. You will first need to check that your TV supports either 720p or 1080p as well as HDCP. If you are able to get the video working over the DVI connection, you may also require a DAC in order to connect with Apple TV's optical audio output to the TVs audio imput.
    You may well wish to make sure that the DVI connection works before spending any money on a DAC..

  • My tv does not have a HDMI port, but my cable digital box does can that work?

    So my tv is a LCD Monitor and it does not have a HDMI entrance, but I am using a a digital box for my cable which does have a HDMI cable. Is there a chance by connecting it to the digital box I can get it to work. If not, what are my options to make my Apple TV to work? I already bought it.

    Will this guaranteed work?
    http://www.amazon.com/gp/product/B008FO7PQA/ref=as_li_ss_tl?ie=UTF8&camp=1789&cr eative=390957&creativeASIN=B008FO7PQA&linkCode=as2&tag=solyoutec-20

  • HT1338 Why can't I update my iPad iso 4.2 version? I go to setting and it does not have it like it should. Why does apple have to make things so freaking hard! Help!

    Why can't I update my iPad iso 4.2 version? I go to setting and it does not have it like it should. Why does apple have to make things so freaking hard! Help!

    If you have an original iPad 1, the latest version of iOS it can run is iOS 5. So you should be able to update no problem.
    Update iTunes to the latest version (11.0.2). Then simply plug your iPad into the computer and open iTunes. Click the iPad either in the sidebar or the top navigation bar. Then attempt to update the software. If it doesn't work, please post the exact error message.
    Note that it would be wise to first ensure you back up the iPad.

  • I purchased Adobe Pro XI last February. I have tried to reinstall it and I keep getting the message that I have a valid serial # but no qualifying product. What is the issue?

    I purchased Adobe Pro XI last February. I have tried to reinstall it and I keep getting the message that I have a valid serial # but no qualifying product. What is the issue?

    Hey robertb86490977,
    The reason why you are getting this prompt is because you are trying to install an upgrade version.
    During the upgrade, you will need to enter serial number twice.
    The first time, you need to enter the serial number of the actual product that you have purchased.
    The second time, you need to enter serial number for the previous version that you had.
    So, please enter serial number of the previous version at the second prompt.
    Let me know if you need further assistance.
    Regards,
    Anubha

  • HT201210 Trying to update to IOS 6 and get the "You do not have permission to upgrade your iphone" Any ideas! All up to date on ITunes, Mac OS etc

    Trying to update to the new IOS 6. However it goes through then comes back with the " The user "x" does not have permission to update this iphone?"
    Any ideas!?
    Thanks
    James

    Im having the same problem after installing ios7.1
    Checked the usb status and it sees an iphone ( 4s ) attached,
    Repaired disc permissions
    updated and reset iphone
    and itunes
    reinstalled mavericks from scratch
    phone alert saying " TRUST THIS COMPUTER?"
    hit trust
    same alert keeps appearing
    again and again
    itunes keeps wittling on about "iTunes could not connect to this iPhone. You do not have permission."
    what the actual F*** is going on and can anybody help ??????

  • Why IVisualElementContainer does not have "getChildren" method defined?

    Hi all,
    In Flex 3 SDK Container.as has method getChildren() and rawChildren property typed as IChildList.
    But In Flex 4 the interface IVisualElementContainer does not have a definition for getChildren() > thus neither SkinnableContainer nor Group have this method defined.
    Was this decision made deliberately to simplify the interface API?
    I find it convenient to have "getChildren" method implemented inside Group and SkinnableContainer,  for example this can be useful if I want to access all visual childs of those containers to pass them along to some manager class or to dynamically set some common property of all childs ( e.g visibility).

    MX had a concept of two sets of children: regular children and raw children.  One component could have two children lists.
    Spark simplifies this concept because of the skin.  Now there's really only one set of children.  Because of this IVisualElementContainer acts like IChildList and has a very similar API.  You should be able to use IVisualElementContainer as you would IChildList before.
    Note that in places where we do have more than one-set of children, we don't expose them on the main object, but require you to dig down in to the separate object (the skin or the controlBarGroup for example).
    Hope that helps,
    Ryan

  • Alum BT keyboard does not work after wake up - but BT trackpad does!

    Here is my set up:
    MBAir 2011 model (13", i7 4GB, Lion.. all up to date)
    Desktop set up (same at work and home)
    - Thunderbolt display
    - Aluminum Bluetooth Keyboard
    - Aluminum Bluetooth Trackpad
    What I do:
    - Plug in the sleeping mbair into my display via thunderbolt and power cable
    - Wake up using external bluetooth trackpad
    - computer wakes up and external trackpad is functional (it always works)
    - 7/10 times the external keyboard will not connect to enter password to get into system
         - I have tried power button banging on it for a long time and does not work
         - open mbair and type password in and remove keyboard and repair and after several tried it will work
         - then I can close mbair and use external keyboard
         - painful to do this most days at home and work
    What have I tried
    - PRAM, SMC reset
    - remove all BT entries - trash blutooth properties files and freshly add them back
    - I have tried waking using keyboard as well and it does not work
    Only think I have wanted to try and have not found out is, if keyboard can reset to factory.
    Yes I also have the occasionaly wifi not connecting from sleep issue

    Hello
    Have you noticed this problem on factory settings or only on your Windows 7 installation? Maybe its just a driver or software issue
    Make also sure that latest BIOS version is installed. Look on the Toshiba website for an update:
    http://eu.computers.toshiba-europe.com > Support & Downloads > Download Drivers
    Before you start the update, make sure that all programs are closed and you are logged in as Administrator.

  • Firefox Does not load most of websites but other browsers does

    Hello, I have a problem.. Suddenly my firefox stopped working properly. I didnt install or changed a setting lately but still...
    most of the pages does not load, or it take ages to load. With other browsers works fine, it loads really fast... I don't know what can cause this problem.. I tried to disable IPv6 as i saw on a tutorial, i scanned for viruses and malwares, but still nothing. Could you help me please?

    It's a noscript bug. Install the latest development build will solve it. Check http://forums.informaction.com/viewtopic.php?f=7&t=5699

  • I am trying to create a website online. The sitebuilder does not have it's navigation bar. It does with Internet Explorer

    I am using 2 website builders online -Leagueapps and Teamthing - to build a sports league management site. Both have wysiwyg pagebuilders. Both are missing the navigation/menu bar.
    I tried Internet Explorer and the navigation/menu bar is there. However I get lots of pop up advertisements even though pop up blocker is enabled.
    I prefer Firefox as a browser and would welcome any advice as to how to rectify this glitch.

    Firefox needs 32-bit plugins, so you'll need to install 32-bit Java for Firefox.
    No, you can't change Firefox from 32-bt to 64-bit. There is a Nightly 64-bit version (alpha) of Firefox, but it is used only to test for regressions until development is resumed.

  • I get the message that I have made a purchase but it did not download

    I made an in app purchase but it didn't download.  Can I download it manually or get a refund?

    Hello Eaglebks,
    It sounds like you have purchased something from iTunes and want to download it. You should be able to use this article to download it:
    Download past purchases
    http://support.apple.com/kb/ht2519
    If you cannot download it, you can also report an issue with the purchase to the iTunes Store support directly with this article:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase
    http://support.apple.com/kb/ht1933
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • SQL server agent job running as Agent Service Account whose service account does not have r/w access but is still able to write?

    Hi. I am newer to SQL server security and am reviewing some of our SQL server's configuration to make sure the services are running under accounts with least privilege.  I have a SQL server 2012 instance whose Agent service is configured to run
    under an AD user account named 'SQLServices'.  The jobs on this server are configured to run as 'SQL server agent service account', which means they should execute as user 'SQLServices'.  The jobs are set up to execute SSIS packages which read and
    write to a database on the same server where the agent job is scheduled and SSIS package installed (all on same server).  The jobs are currently executing without error and are reading writing data correctly.  Upon close examination, it turns out the
    SQLServices account is not assigned to the 'sysadmin' role and had no users mapped to any databases on this server.  How are these jobs working?  I verified in profiler that the login name indeed is 'SqlServices'.  I also verified
    that SQLServices login has no database access by remote-ing onto the server and trying to log into the DB, and access was denied as expected.  According to the literature, the Agent service needs to be a member of 'sysadmin role' but I am reading
    some cases where that is not necessarily the case.  So this is not so concerning.  What is concerning is that the login 'SQLServices' had no access to the databases on that server yet it is reading and writing to the databases as if it does. 
    The only thing I can think of is maybe jobs run as 'SQL server agent service account' on the same server as the databases it r/w to somehow has some kind of default access.  What am I missing here?  Any input would be helpful.

    After 2 days on this forum I found the answer to my own question.  In retrospect, I should have posted this under 'SQL Server Security', but I didn't know it existed.
    The 2 threads below explain that Sql agent actually runs using SID (service) NT SERVICE\SQLSERVERAGENT if you chose that when you installed.  This will automatically create an associated login NT SERVICE\SQLSERVERAGENT in SQL server with sqladmin
    role.  This is the login that Agent uses to connect to the local instance of SQL server.  If you changed to domain account to run the service during install or after using config manager, basically NT SERVICE\SQLSERVERAGENT is still
    used to connect to your local instance behind the scenes (even though you will still see your domain user as account), and the domain account is used to reach outside the server. 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9e6bb2de-8fd0-45de-ab02-d59bbe05f72e/servicedatabase-accounts-nt-servicemssqlserver-nt-servicesqlserveragent-what-are-they-for
    https://social.technet.microsoft.com/Forums/sqlserver/en-US/b83a52fd-fe11-4c28-a27b-88be8ae79f2a/how-do-i-change-sql-server-agent-service-account-to-nt-servicesqlserveragent?forum=sqlsecurity

Maybe you are looking for

  • Windows 8 and Syncing

    Using Windows 8 and iPhone 5 icon won't display under devices in iTunes. Does anyone know if the iPhone 5 can be sync'd up using Windows 8?

  • Network settings tab is blank

    Hi, I have connected a Compact Rio 9068 directly to my computer (HP EliteBook 840 G1, Windows 7), and the system appears in the tree under Remote systems in MAX. However, the problem is that I can only see information under the System Settings tab, w

  • Add domain to email account name...

    Hey guys. We are running into a problem were we need to add @domain.com to all our users macmail settings. Instead is there an applescript we can run that only changes the username to simply add @domain.com? This would be a huge help! Thanks to any i

  • Error:1 Issue Elements 10

    I just recently had to uninstall and reinstall my adobe elements 10 (window). But now as I click to initiate it the Error: 1 comes. What us that and how do I resolve it? Thanks

  • Lion frezees right after login

    So, I got my brand new iMac yesterday.. when I first turned it on everything was fine.. I proceed then to install windows 7 via bootcamp.. and after that when I try to get to mac again, the system opens and freezes..the mouse moves but won't click an