0

I have data being fed into two tables from two different sources - a calculation is done comparing respective price fields between the two tables and then information from the tables are output via EF / datatables to the ASP.NET MVC web client.

This will take place every few seconds.

For the sake of performance I'm thinking I could compare the respective tables and output the resulting data to a SQL Server view only where the prices compared positively which then could more speedily be read by the web client.

But how can Entity Framework connect to a SQL Server view rather than table? Or would it be possible to mimic the effect of a view myself in a calculated table?

I'm using code-first rather than db-first, by the way.

Thank you.

Simon

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user6063812
  • 191
  • 2
  • 15
  • EF doesn't know the difference, just point to the view... – Erik Philips Aug 27 '16 at 02:44
  • I've not done this but I think being you are using code first you would let EF create the tables, then create the views from wihtin SQL, then you can use Visual Studio refresh the changes in the database back to the code and add the new view. – GreatJobBob Aug 27 '16 at 02:45
  • http://stackoverflow.com/questions/7461265/how-to-use-views-in-code-first-entity-framework – Tassadaque Aug 27 '16 at 04:35

0 Answers0