Entity Framework - Generating Classes

前端 未结 4 1764
星月不相逢
星月不相逢 2020-11-30 19:27

I have an existing database. I was hoping there was a way to generate class files from this database. However, I seem to see a lot of generating the database from the class

4条回答
  •  星月不相逢
    2020-11-30 20:00

    1. Open the EDMX model
    2. Right click -> Update Model from Browser -> Stored Procedure -> Select your stored procedure -> Finish
    3. See the Model Browser popping up next to Solution Explorer.
    4. Go to Function Imports -> Right click on your Stored Procedure -> Add Function Import
    5. Select the Entities under Return a Collection of -> Select your Entity name from the drop down
    6. Build your Solution.

提交回复
热议问题