我得到的错误是:
找不到类型或命名空间名称“LastSundayDate”(您是否缺少 using 指令或程序集引用?)
这是我的视图代码:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Report/Report.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<LastSundayDate>>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Trade Searches Data
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>TradeUK KPI Searches Data</h2>
<p></p>
然后我有:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TradeUK.Entities.Reporting
{
public class LastSundayDate
{
public virtual int Title { get; set; }
public virtual int Total { get; set; }
public virtual int Week6 { get; set; }
public virtual int Week5 { get; set; }
public virtual int Week4 { get; set; }
public virtual int Week3 { get; set; }
public virtual int Week2 { get; set; }
public virtual int Week1 { get; set; }
}
}
在我的控制器中,我有:
public ActionResult TradeUKKPIShowData(DateTime date) //show actual data in the view
{
var reportData = _reportingService.GetTradeUKKPISearches(date);
return View(reportData);
}