【发布时间】:2017-02-26 10:24:36
【问题描述】:
无法将类型“DoctorFront.Models.DocMaster”隐式转换为“System.Collections.IEnumerable”。存在显式转换(您是否缺少演员表?)
namespace DoctorFront.Controllers
{
public class DoctorController : ApiController
{
static readonly IDocRepositories Repository =new DocRepositories();
public IEnumerable GetAllDoctor()
{
return Repository.GetAll();
}
public IEnumerable GetDoctor(int id)
{
return Repository.Get(id);
}
}
}
【问题讨论】:
-
我猜你的
GetDoctor方法是为了返回DocMaster,对吧? -
将返回类型更改为
DocMaster。 -
是的,它返回文档主表
-
谢谢@Amit Kumar Ghosh 它成功了
标签: .net razor asp.net-mvc-5