none
Adding entity framework dll into project RRS feed

  • Question

  • Problem when adding entity framework model dll into project

    when running "Enable-Migrations" in nuget package console I get the following errors :

    "Job_Supervisor.DAL.tblJob: : EntityType 'tblJob' has no key defined. Define the key for this EntityType."

    I got the dll from another developer and trying to add it to my project to use. any ideas?

    Tuesday, January 7, 2020 8:25 AM

Answers

  • Job_Supervisor.DAL.tblJob: : EntityType 'tblJob' has no key defined

    The error message means that tblJob a table in the database and an entity object used by the Entity Framework has no primary-key. EF will not work for a table in  the database that has no primary-key.  

    I got the dll from another developer and trying to add it to my project to use. any ideas?

    You need to go back to the developer and find out why EF has detected no primary-key for tblJob.


    • Edited by DA924x Tuesday, January 7, 2020 8:54 AM
    • Marked as answer by Naasp Tuesday, January 7, 2020 10:53 AM
    Tuesday, January 7, 2020 8:53 AM