Hi! Please forgive any newbie mistakes.
I'm writing a receipt detail lookup tool in MVC 2.0 to pull up receipt details from our POS database. I have the stored procedures written that return the data that I need. I have my sprocs loaded in a repository. When I try and load these sprocs in a partial view I get a stack overflow error. If I load the same code directly in the view it works fine. Am I missing something?
Repository entry
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace CSTools.Models
{
public class QueryRepository
{
RDataContext DB = new RDataContext();
public IEnumerable<CSTools.Models.spGetReceiptDataResult> GetReciptData(int storeID, int transactionNumber)
{
var recipt = from rc in DB.spGetReceiptData(storeID, transactionNumber)
select rc;
return recipt;
}
}
}
Controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CSTools.Models;
namespace CSTools.Controllers
{
public class RetailController : Controller
{
QueryRepository Queries = new QueryRepository();
//
// GET: /Trackside/
public ActionResult Index()
{
return View();
}
public ActionResult ReceiptView()
{
return View();
}
public ActionResult ReceiptDataView(int storeID, int transactionNumber)
{
var Receipt = Queries.GetReciptData(storeID, transactionNumber);
return View(Receipt);
}
}
}
View:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
ReceiptView
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>ReceiptView</h2>
<% Html.RenderPartial("ReceiptView"); %>
</asp:Content>
Thanks!
Neil