我是asp.net web api 世界的新手。我对 get()、put()、post() 和 delete 有了基本的了解。
在我的应用程序中,我需要另外两个 get() 方法。下面给出解释——
public class StudentController : ApiController
{
public IEnumerable Get()
{
//returns all students.
}
//I would like to add this method=======================
[HttpGet]
public IEnumerable GetClassSpecificStudents(string classId)
{
//want to return all students from an specific class.
}
//I also would like to add this method=======================
[HttpGet]
public IEnumerable GetSectionSpecificStudents(string sectionId)
{
//want to return all students from an specific section.
}
public Student Get(string id)
{
//returns specific student.
}
}
angularjs 控制器中已经有一个$http.get(..)
。
我的问题是,如何get()
从角度控制器调用这两种附加方法。