1

I'm using Entity Framework 4.3 and I'd like to create a view because of the low performance of some selects. Is possible to do it from code?

Deise Vicentin
  • 137
  • 1
  • 4
  • 23

1 Answers1

2

Peter Kellner has mentioned in his article:

With CodeFirst, making views is problematic because you are not actually creating your own tables and columns so going directly into the database is really not something you should do. Creating a view basically violates one of the main purposes of CodeFirst which is to remove you from having to see database details. Making a view now tightly binds your model to that view and if you change you model and not the view you are in for trouble.

For more information visit Entity Framework Code First From Microsoft, Best and Worst Practices and How do I define a database view using Entity Framework 4 Code-First?

Community
  • 1
  • 1
Abbas Amiri
  • 3,074
  • 1
  • 23
  • 23