How can I call a SQL Stored Procedure using EntityFramework 7 and Asp.Net 5
<p>For last couple of days I am searching for some tutorials about how to call a <code>Stored Procedure</code> from inside a <code>Web API</code> controller method using <code>EntityFramework 7</code>.</p>

<p>All tutorials I came through are showing it the other way round, i.e. <code>Code First</code> approach. But I already have a database in place and I need to use it to build a <code>Web API</code>. Various business logic are already written as Stored Procedures and Views and I have to consume those from my Web API.</p>

<p>Question 1: Is this at all possible to carry on with <code>Database First</code> approach with <code>EF7</code> and consume database objects like above?</p>

<p>I installed <code>EntityFramework 6.1.3</code> to my package by the following <code>NuGet</code> command:</p>

<p><code>install-package EntityFramework</code>
which adds version 6.1.3 to my project but immediately starts showing me error message (please see the screenshot below). I have no clue about how to resolve this.</p>

<p><a href="https://i.stack.imgur.com/bfukf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bfukf.png" alt="enter image description here"></a></p>

<p>I have another test project where in <code>project.json</code> I can see two entries like following:</p>

<p><code>"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer.Design": "7.0.0-rc1-final",</code></p>

<p>However, when I am searching in <code>Nu-Get</code> package manager, I don;t see this version! Only 6.1.3 is coming up.</p>

<p>My main objective is to consume already written Stored Procedures and Views from an existing database.</p>

<p>1) I do not want to use <code>ADO.Net</code>, rather I would like to use <code>ORM</code> using <code>EntityFramework</code></p>

<p>2) If <code>EntityFramework 6.1.3</code> has the ability to call <code>Stored Procs</code> and <code>Views</code> from already existing database, how I can resolve the error (screenshot)?</p>

<p>What is the best practice to achieve this?</p>