2017-01-03 9 views
0

Hier verwende ich Asp.NetWebApi. Ich schrieb einige Code wie:WebApi MultiplulUrl nicht unterstützt

public IEnumerable <Employee> GetEmployee() 
{ 
var x = pro.GetEmployees(); 
return x; 
} 
public Employee GetEmployee(int id = 0) { 
var x = pro.FindEmployee(id); 
return x; 
} 

Es wirft einen Fehler, wie ich eine URL wie http://localhost:57997/api/Friends passieren. Wenn ich dieses Employee GetEmployee(int id = 0) Stück Code auskommentieren, funktioniert es gut.

Mehrere Aktionen wurden gefunden, die der Anforderung entsprechen: GetEmployee auf Typ Application.Api.Controllers.FriendsController GetEmployee auf Typ Application.Api.Controllers.FriendsController

Antwort

0

Bitte entfernen Sie diesen Code

Employee GetEmployee(int id = 0) 

Und fügen Sie diese

Employee GetEmployee(int id)