locked
can't find edmx file in Entity Framework RRS feed

  • Question

  • User136806914 posted

    I am new to Entity Framework & trying to maintain a project that is built using EF v6.1.3. I am trying to do Data model refresh but unfortunately i can't seem to find any edmx file under my solution.

    P.S:Entity Framework is already installed 

    Tuesday, February 21, 2017 2:16 AM

Answers

All replies

  • User-821857111 posted

    Are you certain that the project is a Database-first project and not a Code-first project?

    Tuesday, February 21, 2017 8:56 AM
  • User136806914 posted

    I think you may be right, it could be Code first project. I thought since Database already exist he might have used Database first project but since there were no proper constraints on tables he might have used Code first. How do i confirm if its Code first or DB first approach??

    He also tried to enter keys manually

    [Key, Column(Order =1)]
    [DatabaseGenerated(DatabaseGeneratedOption.None)]

    Tuesday, February 21, 2017 3:14 PM
  • User-821857111 posted

    The lack of an edmx file strongly suggests that it is code first, as do the schema annotations on the entities. You can do Code First to an existing database - even to a badly designed one.

    https://msdn.microsoft.com/en-us/library/jj200620(v=vs.113).aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 21, 2017 8:56 PM