none
Model duplicated RRS feed

  • Question

  • Hi there, 

    I created Model named BuildingModel but I did not nottice that the table did not have the primary key. 

    So: 

    1. Altered the table adding Primary Key

    2. Closed the Solution and Visusal Studio

    3.  git reset --hard origin/master

    4. Opened the Solution

    5. Checked that the model BuildingModel is missing from the Models folder 

    6. Attempted to add the new Model called BuildingModel 

    Error:

    But the BuildingModel is not present.


    Makes no sense, does it ?

    • Moved by CoolDadTx Thursday, March 23, 2017 2:10 PM EF related
    Thursday, March 23, 2017 12:24 PM

Answers

  • Also you could try deleting the model and regenerating it again see if this solves your issue.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    • Marked as answer by btsDeveloper Thursday, March 23, 2017 2:46 PM
    Thursday, March 23, 2017 1:00 PM

All replies

  • Hi btsDeveloper,

    Did you check your project folder see if same name is already exist there?

    Also do this:

    > Check if file already exist in the Git folder. Clear that,

    > Clean Solution

    > Rebuild Project

    > Rebuild Solution


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]


    Thursday, March 23, 2017 12:40 PM
  • Yes indeed.

    Should I remove all the files that start with BuildingModel* ?



    Thursday, March 23, 2017 12:45 PM
  • I think you could pull those files -> do your operation -> -> add . -> commit -> then push that back again.

    This should work.


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]



    Thursday, March 23, 2017 12:48 PM
  • My github repository does not contain the BuildingModel files. What I wanted to do was to revert back to a snapshot, after making a mistake so I used git reset --hard origin/master thinking that this will restore the project to a previous state. Apparently it’s not how it works and I would first need to purge (delete) the files in my local project directory ???


    Thursday, March 23, 2017 12:56 PM
  • Also you could try deleting the model and regenerating it again see if this solves your issue.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    • Marked as answer by btsDeveloper Thursday, March 23, 2017 2:46 PM
    Thursday, March 23, 2017 1:00 PM