none
Issue when mapping an entity to database view in code first RRS feed

  • Question

  • Hello,I am wondering if someone can help me in my following problem.

    I am using code first entity framework approach in my project and i need to use a database view for some purpose.In order to get properties of database view,i create an model and try to bind it with my database view.However,my model create a separate table in database and not mapping to view.

    Is there any way of mapping an entity to database view using code first.I want to map it with view but not create a separate table.

    Friday, April 10, 2015 7:38 AM

Answers

  • Hello akritiPatel,

    >>Is there any way of mapping an entity to database view using code first.I want to map it with view but not create a separate table.

    Yes, it could be, you could use the Entity Framework Power Tools to generate your code first model according your existed database automatically.

    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.


    Monday, April 13, 2015 11:08 AM
    Moderator