首页 > 解决方案 > Error at creating a List View template in MVC, stored procedure in ASP.NET MVC

问题描述

I am trying to create a listview template in ASP.NET MVC and fill it through a stored procedure model class from the database, I am using EF, however when I try to create the view the following error is displayed:

Unable to retrieve metadata for JobPortalCandidates.SP_CND_Positions_Result

The name of the stored procedure is SP_CND_Positions.

View Template Wizard in VS:

View Name: Index
Template: List
Model Class: SP_CND_Positions_Result (JobPortalCandidatesMVC)

This is my controller

[Authorize]
public ActionResult Index()
{
    CandidateEntities Positions = new CandidateEntities();
    return View(Positions.SP_CND_Positions());
}

What's wrong with it?

Thanks in advance

标签: c#asp.netasp.net-mvcentity-framework

解决方案


推荐阅读