0
を使用してビューにレコードを渡し、私は4.0エンティティフレームワーク
私はビューにタイプ「文」のデータベースレコードを渡す必要があり、MVC3とEntity Frameworkの.NET 4.0を使用しています。レコードをフェッチするコードは以下の通りです:
「uspInvoiceStatementは」私は「声明」 を受けて強く型付けされたビューを作成しているの「声明」を取得するために使用私のストアドプロシージャです
public ActionResult pdfStatement(string InvoiceNumber)
{
ObjectParameter[] parameters = new ObjectParameter[1];
parameters[0] = new ObjectParameter("InvoiceNumber", InvoiceNumber);
return View(_db.ExecuteFunction<Models.Statement>("uspInvoiceStatement", parameters));
}
私は、アプリケーションを実行すると
< % @ Page Language="C#" Inherits="System.Web.Mvc.ViewPage <InvoiceSearch.Models.Statement>" %>
は私が言って例外を取得
"The model item passed into the dictionary is of type 'System.Data.Objects.ObjectResult`1[InvoiceSearch.Models.Statement]',
but this dictionary requires a model item of type 'InvoiceSearch.Models.Statement'.
このトラブルから逃れるのを助けてください。 「