在mvc asp.net的浏览器中找不到API控制器

埃桑·阿克巴尔(Ehsan Akbar)

我在single page application.i中是个新手,webapi您可以在此处创建一个

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Description;
using WebApplication6.Models;

namespace WebApplication6.Controllers
{
    public class ManageStudentInforAPIController : ApiController
    {
        private SchoolManagementEntities db = new SchoolManagementEntities();

        // GET: api/ManageStudentsInfoAPI  
        public IQueryable<Student> Get()
        {
            return db.Students;
        }
    }
}

但是当我调用此URL时http://localhost:5411/ManageStudentInforAPI,结果是

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /ManageStudentInforAPI

我的问题在哪里。您需要的任何详细信息都可以发布。我正在使用vs2015

在此处输入图片说明

苏里亚

您尝试将控制器作为http:// localhost:5411 / Api / ManageStudentInforAPI调用,这应该可以工作

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章