刚开始弄乱存储库/接口等,在选择一条我无法解决的记录时出现错误。
我的控制器有:
public ViewResult Detail(int ID)
{
var Details = (from x in repo.GetBreakdown(ID) select new BreakdownDetailViewModel { }).SingleOrDefault();
return View(Details);
}
语句 repo.GetBreakdown(ID) 带有以下错误的下划线:
Could not find an implementation of the query pattern for source type ''. 'Select' not found.
我的界面显示:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Entities;
namespace Domain.Abstract
{
public interface IBreakdownRepository
{
tblBreakdown_Log GetBreakdown(int ID);
IQueryable<tblBreakdown_Log> GetAllBreakdowns { get; }
}
}
存储库本身具有:
public tblBreakdown_Log GetBreakdown(int ID)
{
return (from x in db.tblBreakdown_Logs where x.MB_ID == ID select x).SingleOrDefault();
}
关于这里的问题有什么想法吗?
谢谢,克里斯