none
Add new View to edmx

    Question

  • Hello Friends,

    I am new to entity framework and got stuck at one place. I have a .net project, which has entity framework implemented and need to implement one aspx form to display result from the database.

    At database I have created a view and added that view to edmx file using 'Update model from Database'. There is one more folder I can see in the project folder, which has .tt as extension. Within this .tt extension there are class files created automatically.

    I added the view to edmx but don't know how to create the class file for the view in .tt folder. Do I need to manually create the class file ?

    Please help.

    Wednesday, July 02, 2014 6:38 AM

Answers

  • Hello,

    >>I added the view to edmx but don't know how to create the class file for the view in .tt folder. Do I need to manually create the class file ?

    No, you needn’t, it will generated a view type class for you automatically. After you update model from database, you can see there is a class under .tt file.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by S Prashant Wednesday, July 02, 2014 12:36 PM
    Wednesday, July 02, 2014 9:40 AM
    Moderator

All replies

  • Hello,

    >>I added the view to edmx but don't know how to create the class file for the view in .tt folder. Do I need to manually create the class file ?

    No, you needn’t, it will generated a view type class for you automatically. After you update model from database, you can see there is a class under .tt file.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by S Prashant Wednesday, July 02, 2014 12:36 PM
    Wednesday, July 02, 2014 9:40 AM
    Moderator
  • Thanks for the reply. I added view to the edmx file but also I had to right click on tt file and click 'Run Custom Tool'. This resolved my issue and its working fine now.
    Wednesday, July 02, 2014 12:35 PM