Execute stored procedure in ASP.NET MVC and LINQ
<p>I'm very new to ASP.NET, so this may be a very basic question. Anyway, I want to execute a stored procedure on a server. I'm using, as in the heading mentioned, ASP.NET MVC. Currently it is possible to query the whole table: </p>

<p>Controller:</p>

<pre><code>public JsonResult GetLaptopsJson()
{
    Laptop[] laptops = context.GetTable&lt;Laptop&gt;().ToArray();
    return Json(laptops, JsonRequestBehavior.AllowGet);
}
</code></pre>

<p>Javascript:</p>

<pre><code>$.ajax({
            url: '/Home/GetLaptopsJson',
            contentType: 'application/html; charset=utf-8',
            type: 'GET',
            dataType: 'json' 
       })
       .success(function (result) {
            $('#search_result').empty();
            for (var i = 0; i &lt;= (result.length - 1); i++)
            {
                add_result(result[i].Id, result[i].Price);
            }
        })
        .error(function (xhr, status) { 
             alert(status);

        });
</code></pre>

<p>Model:</p>

<pre><code>[Table(Name = "Laptop")]
public class Laptop
{
    [Column(IsPrimaryKey = true)]
    public int Id { get; set; }
    [Column]
    public string Name { get; set; }
    [Column]
    public decimal Price { get; set; }
}
</code></pre>

<p>If I change the controller to following, it returns nothing:</p>

<pre><code>var laptops = context.ExecuteQuery&lt;Laptop&gt;(@"exec [dbo].[sp_Select_Laptop]");
</code></pre>

<p>Also if I change the type from laptop to object, it returns nothing. This leads me to the fact, that I misunderstood something fundamental. </p>

<p>Thanks in advance guys!</p>

<p><strong>EDIT1:</strong></p>

<p>Stored procedure code:</p>

<pre><code>CREATE PROC [dbo].[sp_Select_Laptop]
AS
    SET NOCOUNT ON

    SELECT 
        [ID], [Name], [Price]
    FROM 
        [dba].[dbo].[Laptop]
GO
</code></pre>