3

I am still learning Entity Framework Core. I have already created a data context object and created a SQL database using the code-first approach.

Now I want to display data from a pre-existing SQL database. This pre-existing database has several tables and most of the business logic is written in stored procedures.

Is it possible to create another DB context object and use only the stored procedures from it without creating table schema objects?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Massey
  • 1,099
  • 3
  • 24
  • 50

1 Answers1

2

The purpose of EF Core is to have Models representing any data you store or retrieve from the database. Since a stored procedure can retrieve information, you will want a class with defined properties that match the result of that stored procedure.

How to do this can be found in the Stack Overflow article found here: https://stackoverflow.com/a/44244738/5636865

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
TeaBaerd
  • 1,104
  • 11
  • 16